F'Zone offers three different types of burgers to hungry students in Fairmont. You have to write a small program in C++ to calculate the price of a burger order. Your program should display the following menu to the user and prompts for his/her choice:
1: Quarter pounder combo
2: Bacon burger
3: Swiss mushroom burger
· If the user enters 1, then the program should ask the user if he wants the “biggy” size and if he wants to add cheese. The combo costs $4.59; “biggy” size costs $.39 more, and cheese costs $.25 more.
· If the user enters 2, then the program should ask the user if he wants to add cheese and fries. The burger costs $3.49; fries costs $.59 more, and cheese costs $.25 more.
· If the user enters 3, then the program should ask the user if he wants to add onion rings and a coke. The burger costs $4.99; onions rings costs $.79 more, and coke costs $.75 more.
· If the user enters anything else, the program should display an error message and terminate.
For the YES/NO answers, the user should enter an upper case 'Y' or 'N'. All prices include tax. Finally, the total of the order should be calculated and displayed in dollars and cents. The input/output of the program should strictly follow the format shown in the sample executions.
For character input, you should use the getchar function. Following is an example of how you can use this:
char x;
x = getchar();
2006-11-05
16:34:49
·
3 answers
·
asked by
rh138
1
in
Computers & Internet
➔ Programming & Design