SHARE
TWEET

Untitled

a guest Sep 15th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.   const float COST_EYE = 3.35;
  6.   const float COST_SPLEEN = 2.75;
  7.   const float COST_LIVER = 14.58;
  8.   const float COST_APPENDIX = 0.50;
  9.   const float COST_BRAINS = 7.85;
  10.   const float COST_EAR = 13.45;
  11.  
  12.   const float WT_BRAIN = 0.4;
  13.   const float WT_SPLEEN = 5.6;
  14.   const float WT_LIVER = 3.0;
  15.   const float WT_APPENDIX = 1.2;
  16.   const float WT_EYE = 2.3;
  17.   const float WT_EAR = 10.0;
  18.  
  19.   char input;
  20.   int quit = 0;
  21.  
  22.   while(quit == 0)
  23.   {
  24.     cout << "MAIN MENU" << endl;
  25.     cout << "1.) eyeballs" << endl;
  26.     cout << "2.) spleen" << endl;
  27.     cout << "3.) liver" << endl;
  28.     cout << "4.) appendix" << endl;
  29.     cout << "5.) brains" << endl;
  30.     cout << "6.) earlobes" << endl;
  31.     cout << "7.) Quit" << endl;
  32.  
  33.     cin >> input;
  34.  
  35.     switch(input)
  36.     {
  37.       case '1':
  38.         cout << "That will cost $3.35" << endl;
  39.         break;
  40.       case '2':
  41.         cout << "That will cost $2.75" << endl;
  42.         break;
  43.       case '3':
  44.         cout << "That will cost $14.58" << endl;
  45.         break;
  46.       case '4':
  47.         cout << "That will cost $0.50"  << endl;
  48.         break;
  49.       case '5':
  50.         cout << "That will cost $7.85"  << endl;
  51.         break;
  52.       case '6':
  53.         cout << "That will cost $13.45"  << endl;
  54.         break;
  55.       case '7':
  56.         quit = 1;
  57.         break;
  58.     }
  59.   }
  60.   return 0;
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top