Question
MODIFY THIS C++ PROGRAM Modify the struct so that the values for coffee name are enumerated as 1=light, 2=medium, 3=dark. Then add to the struct
MODIFY THIS C++ PROGRAM
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. The program should loop until the user chooses to quit in the main menu.
#include
struct Coffee { string name; float cost; int strength; bool cream; int amtofsugar; }; int main() { string quit; Coffee coffee; do {
cout<<"What type of coffee is it? Columbian, French Roast, Italian Blend, or House?"<
cout<<"Coffe Info:"< if(coffee.strength==1) cout<<"Strength: "<<"Light"< else if(coffee.strength==2) cout<<"Strength: "<<"Medium"< else cout<<"Strength: "<<"Dark"< else cout<<"Cream: "<<"No"< cout<<"Enter 'quit' to quit or go through the options again."<
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started