Question: Write a complete program in C++ only Define a struct for a coffee order and the struct will contain a string for the coffee name

Write a complete program in C++ only

Define a struct for a coffee order and the struct will contain a string for the coffee name (Columbian, French Roast, Italian Blend, or House), a float for the cost, an integer for the strength (1-light, 2-medium, 3-dark), an int for the amount of sugar (0-none, 1, 2, 3, 4), a bool for cream or not cream. Modify the struct so that the values for coffee name are enumerated as 1=light, 2=medium, 3=dark. Then add to the struct an attribute for coffee size that will be enumerated as small=0, regular=1, medium=2, large=3, extra-large =4. The cost is calculated as follows small $1.50, , regular $2.10, medium $2.50, large $3, extra-large $4.25. Add .25 if they choose French roast or Italian blend, add .13 for each level of sugar, and add .08 for cream.

Create another struct for customer. The costumer has attributes for first name, order number which is a value between 1 and 100 inclusive, and a coffee struct. In the main program declare an array of customers that is size 100. Next create a main menu. The menu will first ask if the customer wants a cup of coffee and provide choices for yes, no or quit. If the customer chooses yes, the program should ask for the first name and store it in the appropriate location. Next, the program should display the options and allow the user to enter their preferences. Based on the customers input the cost should be calculated. Then the customers order number (array index + 1 is good for this) should be displayed. The program should keep each order in a separate array element. If in the main menu the customer chooses no then the system should ask if they want to see their order. If they choose yes then the program should ask for the order number and then display all of the appropriate information.

Have the program continue to loop and take in information and print information until the user chooses to quit in the main menu.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!