Advertisement
Guest User

segi

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