Advertisement
Guest User

AuthoyCoffeeshopAssignment

a guest
Apr 5th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.03 KB | None | 0 0
  1. //Tabassum Mustafa Authoy
  2. //SUKD1902120
  3.  
  4. /* standard libraries */
  5. #include <iostream>
  6. #include <math.h>
  7.  
  8. using namespace std;
  9. /* main program */
  10. int main()
  11. {
  12.    
  13.  /*variables*/
  14.  char Choice;
  15.  double Price,Quantity,Amount;
  16.  int stop;
  17.  
  18.  /*program display*/
  19.  cout<<" Rose barista coffeeshop is offering different sizes of coffee: Small=1.75 RM, Medium=1.90 RM, Large=2.00 RM \n"
  20.  <<"\n"
  21.  << "Press 'S' for the small size coffee \n "
  22.  <<"\n"
  23.  << "Press 'M' for the medium size coffee \n "
  24.  <<"\n"
  25.  << "Press 'L' for the large size coffee \n  "<<"\n"
  26.  <<endl;
  27.  
  28. //loop statement//
  29. for(;;)
  30. {
  31.     // user's input //
  32.  cout<< "Enter the size of coffee : ";
  33.  cin>>Choice;
  34.  
  35.  
  36.  cout<< "Enter the quantity of coffee : ";
  37.  cin>>Quantity;
  38.  
  39.  cout<< "choice :" <<Choice<<endl;
  40.  
  41.  // conditions //
  42.  if( Choice=='S' || Choice=='s')
  43.     {
  44.      Price=1.75*Quantity;
  45.      Amount=Quantity*9;
  46.      cout<<"Coffee cup's size:"<<Choice<<endl;
  47.      cout<<"Number of Coffee cup's:"<<Quantity<<endl;
  48.      cout<<"Total Money made: RM"<<Price<<endl;
  49.      cout<<"Total Amount of Coffee sold:"<<Amount<<"oz"<<"\n"<<endl;
  50.  
  51.     }
  52.  
  53.  else if( Choice=='M' || Choice=='m')
  54.     {
  55.      Price=1.90*Quantity;
  56.      Amount=Quantity*12;
  57.      cout<<"Coffee cup's size:"<<Choice<<endl;
  58.      cout<<"Number of Coffee cup's:"<<Quantity<<endl;
  59.      cout<<"Total Money made: RM"<<Price<<endl;
  60.      cout<<"Total Amount of Coffee sold:"<<Amount<<"oz"<<"\n"<<endl;
  61.  
  62.     }
  63.  
  64.     else if( Choice=='L' || Choice=='l')
  65.     {
  66.      Price=2.00*Quantity;
  67.      Amount=Quantity*15;
  68.      cout<<"Coffee cup's size:"<<Choice<<endl;
  69.      cout<<"Number of Coffee cup's:"<<Quantity<<endl;
  70.      cout<<"Total Money made: RM"<<Price<<endl;
  71.      cout<<"Total Amount of Coffee sold:"<<Amount<<"oz"<<"\n"<<endl;
  72.  
  73.     }
  74.  
  75.     else
  76.     {
  77.      cout<< "Invalid option"<<"\n"<<endl;
  78.  
  79.     }
  80.  
  81.   // final/escape command //
  82.    cout <<"Press 1 To Continue or Press Any Number To Stop"<<endl;
  83.    cin>>stop;
  84.    if(stop==1) continue;
  85.    else break;
  86.  
  87. }
  88.  
  89. return 0;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement