Cheese Shop
In this walkthrough we will build out a program to manage a fictitious cheese shop. This will include managing stock on hand, and tracking sales.
An example of how this may work is shown below:
===================================Main Menu:===================================0. Exit1. Add cheese2. Edit cheese3. Print cheese listSelect an option (0-3): 1
Enter cheese name: CheddarEnter weight in stock (kg): 2.5Enter price per kg (cents): 2100
===================================Main Menu:===================================0. Exit1. Add cheese2. Edit cheese3. Print cheese listSelect an option (0-3): 1
Enter cheese name: GoudaEnter weight in stock (kg): 1.75Enter price per kg (cents): 1523
===================================Main Menu:===================================0. Exit1. Add cheese2. Edit cheese3. Print cheese listSelect an option (0-3): 2
===================================Select Cheese:===================================0: Select none1: Cheddar: 2.50 kg, $21.002: Gouda: 1.75 kg, $15.23Select cheese (0 - 2): 1
===================================Edit Cheese:===================================Editing cheese: Cheddar: 2.50 kg, $21.00Do you want to edit the name? (1 for yes, 0 for no): 0Do you want to edit the weight? (1 for yes, 0 for no): 1Enter new weight in stock (kg): 1.98Do you want to edit the price? (1 for yes, 0 for no): 0
===================================Main Menu:===================================0. Exit1. Add cheese2. Edit cheese3. Print cheese listSelect an option (0-3): 3
===================================Cheese stock list:===================================Cheddar: 1.98 kg, $21.00Gouda: 1.75 kg, $15.23===================================
===================================Main Menu:===================================0. Exit1. Add cheese2. Edit cheese3. Print cheese listSelect an option (0-3): 0
Exiting...
Switch on some Bazouki music, and let’s consider how to build this program.