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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
#include <string>
#include <iostream>
using namespace std;
int main()
{
int choice; //declare variables
double q=0;
double total=0;
string input ="Y"; //default input is yes
string input2,input3,input4;
double array [13]={1.5, 1.25,2.25,2.5,2.25,2.75,2.5,1,1.25, 1.25, 0.75, 1, 0.75}; // declare array
string array1 [13]={"regular coffee ($1.50)", "decaf coffee ($1.25)", "Americano (2.25)", "Latte ($2.50)", "Espresso (2.25)", "Cappuccino ($2.75)", "Macchiato ($2.50)","Plain Muffin ($1.00)", "Raspberry Muffin ($1.25)", "Scone ($0.75)", "Blueberry Scone ($1.00)", "Croissant ($0.75)"};
while (input=="Y" || input=="y"){ // while loop when input=y
cout << "******Hunter Cafe CMS*******" << endl; //menu display
cout <<"Welcome! Here is the Cafe Menu:"<< endl;
cout <<"**Coffee** **Cost($)** **Snacks** **Cost($)**"<<endl;
cout <<"1) Regular 1.50 8)Plain Muffin 1.00"<<endl;
cout <<"2) Decaf 1.25 9)Blueberry Muffin 1.25" <<endl;
cout <<"3) Americano 2.25 10)Raspberry Muffin 1.25" <<endl;
cout <<"4) Latte 2.50 11)Scone 0.75" <<endl;
cout << "5) Espresso 2.25 12)Blueberry Scone 1.00" <<endl;
cout << "6) Cappuccino 2.75 13)Croissant 0.75" <<endl;
cout << "7) Macchiato 2.50"<<endl;
cout <<"what would you like?(1-13):" <<endl;
cin >> choice;
cout << "how many would you like?:" <<endl;
cin >> q; //quantity
cout <<"Would you like anything else?(Y/N):"<<endl;
cin >> input;
total= (q*array[choice-1])+total;
if(input=="N" ||input=="n"){
cout<<"Are you satisfied with your order?(Y/N)"<<endl;
cin >>input2;
if (input2=="Y"){
cout << "Thank you for shopping at Hunter Cafe CMS! Have a nice day!"<<endl;
}
}
}
switch(choice){
case 0:
cout <<"invalid response"<<endl;
case 1:
cout << "you have ordered: "<<q<<array1 [0] <<endl;
cout << "your total is $ "<<total<<endl;
break;
case 2:
cout << "you have ordered: "<<q<<"Decaf coffee ($1.25)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 3:
cout << "you have ordered: "<<q<< "Americano ($2.25)"<< endl;
cout << "your total is $ "<<total<<endl;
break;
case 4:
cout<< "you have ordered: "<<q<< "Latte ($2.50)" <<endl;
cout << "your total is $ "<<total<<endl;
break;
case 5:
cout<< "you have ordered: "<<q<< "Espresso ($2.25)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 6:
cout<< "you have ordered: "<<q<< "Cappuccino ($2.75)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 7:
cout<< "you have ordered: "<<q<< "Macchiato ($2.50)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 8:
cout<< "you have ordered: "<<q<< "plain Muffin ($1.00)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 9:
cout<< "you have ordered: "<<q<< "Blueberry Muffin ($1.25)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 10:
cout<< "you have ordered: "<<q<< "Raspberry Muffin ($1.25)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 11:
cout<< "you have ordered: "<<q<< "Scone ($0.75)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 12:
cout<< "you have ordered: "<<q<< "Blueberry Scone ($1.00)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
case 13:
cout<< "you have ordered: "<<q<< "Croissant ($0.75)"<<endl;
cout << "your total is $ "<<total<<endl;
break;
}
return 0;
}
|