1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#include <iostream>
#include <cstdlib>
# include <string>
using namespace std;
int main()
{
enum Type {Burger=1, Fries, Drink, Salad, Clear, Order, Quit};
cout << "Place your order from JT's Burger Joint. This app shows your calories and cost as you add items to your food order. You can clear, order, or quit at any time.\n";
cout << "Current order: burger:0 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 0 cost: $0.00\n";
cout << "Choose: b)urger f)ries d)rink s)alad c)lear, o)order, q)uit: ";
switch (option) {
case Burger:
case Fries:
case Drink:
case Salad:
/*
This should be the output: Place your order from John R's Burger Joint. This app shows your calories and cost
as you add items to your food order. You can clear, order, or quit at any time.
Current order: burger:0 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 0 cost: $0.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: b
Current order: burger:1 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 200 cost: $1.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: b
Current order: burger:2 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 400 cost: $2.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: c
Current order: burger:0 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 0 cost: $0.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: b
Current order: burger:1 fries:0 drink:0 salad:0 ice cream:0 TOTAL calories: 200 cost: $1.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: f
Current order: burger:1 fries:1 drink:0 salad:0 ice cream:0 TOTAL calories: 300 cost: $1.75
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: d
Current order: burger:1 fries:1 drink:1 salad:0 ice cream:0 TOTAL calories: 450 cost: $3.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: s
Current order: burger:1 fries:1 drink:1 salad:1 ice cream:0 TOTAL calories: 530 cost: $4.50
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: s
Current order: burger:1 fries:1 drink:1 salad:2 ice cream:0 TOTAL calories: 610 cost: $6.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: w
Invalid option, please try again.
Current order: burger:1 fries:1 drink:1 salad:2 ice cream:0 TOTAL calories: 610 cost: $6.00
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: i
Current order: burger:1 fries:1 drink:1 salad:2 ice cream:1 TOTAL calories: 910 cost: $7.75
Choose: b)urger f)ries d)rink s)alad i)ce cream c)lear, o)order, q)uit: o
Thank you for your order! Your total comes to: $7.75
Good-bye. Thank you for giving us the opportunity to serve you.
When user enters ‘q’ to quit at any time, exit the loop and provide a message;
Sorry you decided not to order. Please try us again!
*/
|