Jason has opened a coffee shop at the beach and sells coffee in three sizes: small (9oz) medium (12oz) and large (15oz). Small cost is $1.75 medium costs $1.90 and large costs $2.00. Write a menu driven program that will make the coffee shop operational. The program should allow the user to do the following: 1. buy coffee in any size and any number of cups. 2. at any time show the total number of cups of coffee of each size sold. 3. At any time show the total amount of coffee sold. 4. at any time show the total amount of money made. The program should at the least: 1. a function to show the user how to use the program. 2. a function to sell coffee. 3. a function to show the number of cups of each size sold. 4. a function to show the total amount of coffee sold. 5. a function to show the total amount of money made. No global variables. Special values such as coffee cup sizes and cost of a coffee cup must be declared as named constants.

In order to create a menu driven program for Jason’s coffee shop, several functions need to be implemented. The program should allow the user to buy coffee in any size and any number of cups, display the total number of cups of coffee sold for each size, display the total amount of coffee sold, and show the total amount of money made. Additionally, the program should include a function to guide the user on how to use the program. To ensure modularity and avoid the use of global variables, special values such as coffee cup sizes and cost of a coffee cup should be declared as named constants. Let’s discuss the implementation of each function:

1. Function to show user instructions:
This function should display a message explaining how to use the program. It can provide information about available options and their corresponding commands. The user can input a specific command to access the desired functionality.

2. Function to sell coffee:
This function allows the user to buy coffee in any size and any number of cups. It prompts the user to input the size and number of cups desired. Based on the inputs, it calculates the total cost and updates the total number of cups sold for each size. It also updates the total amount of coffee sold and the total amount of money made.

3. Function to show the number of cups of each size sold:
This function displays the total number of cups of coffee sold for each size. It retrieves and outputs the values stored for each size of cups.

4. Function to show the total amount of coffee sold:
This function displays the total amount of coffee sold. It retrieves and outputs the value stored for the total amount of coffee sold.

5. Function to show the total amount of money made:
This function displays the total amount of money made. It retrieves and outputs the value stored for the total amount of money made.

To ensure maintainability and readability, it is recommended that each function is implemented separately and called when necessary. The use of named constants for special values such as coffee cup sizes and cost of a coffee cup helps make the code more manageable and allows for easy modifications in the future.

By implementing these functions, the program will provide the required functionalities, enabling Jason’s coffee shop to operate smoothly. Customers will be able to buy coffee in any size and any number of cups, while the program keeps track of the total number of cups sold for each size, the total amount of coffee sold, and the total amount of money made.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer