Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int selector();
  8. int exit();
  9. int exitC = 101010;
  10.  
  11. int exit()
  12. {
  13.    
  14.     cout << "Now going to selector" << endl; Sleep(1000);
  15.     system("cls");
  16.    
  17.     selector();
  18.    
  19.     return 0;
  20. }
  21.  
  22.  
  23. int gradeSystem()
  24. {  
  25.     int grade = 0;
  26.  
  27.  
  28.     cout << "Input your number grade here." << endl << endl;
  29.    
  30.    
  31.  
  32.     while (100 == 100)
  33.     {
  34.        
  35.  
  36.        
  37.         cin >> grade;
  38.        
  39.         if (grade == 100)
  40.         {
  41.             cout << "-------------------------------------" << endl;
  42.             cout << "-----You got a perfect score! A+-----" << endl;
  43.             cout << "-------------------------------------\n" << endl;
  44.         }
  45.  
  46.         else if (grade < 100 && grade >= 90)
  47.             cout << "You got a A. Good job!\n" << endl;
  48.  
  49.         else if (grade < 90 && grade >= 80)
  50.             cout << "You got a B. Keep up the good work!\n" << endl;
  51.  
  52.         else if (grade < 80 && grade >= 70)
  53.             cout << "You got a C. Not good, not bad\n" << endl;
  54.  
  55.         else if (grade < 70 && grade >= 60)
  56.             cout << "You got a D. Better luck next time!\n" << endl;
  57.  
  58.         else if (grade <= 59)
  59.             cout << "You got a F. Are you even trying?\n" << endl;
  60.  
  61.         else if (grade == exitC)
  62.             exit();
  63.        
  64.         else if (grade > 100 || grade < 0)
  65.         {
  66.             cout << "Error!" << endl << endl;
  67.  
  68.             cout << "Resets in 5s" << endl;
  69.             Sleep(1000);
  70.             cout << "Resets in 4s" << endl;
  71.             Sleep(1000);
  72.             cout << "Resets in 3s" << endl;
  73.             Sleep(1000);
  74.             cout << "Resets in 2s" << endl;
  75.             Sleep(1000);
  76.             cout << "Resets in 1s" << endl;
  77.  
  78.             system("cls");
  79.  
  80.             gradeSystem();
  81.         }
  82.        
  83.         cout << "Resets in 5s" << endl;
  84.         Sleep(1000);
  85.         cout << "Resets in 4s" << endl;
  86.         Sleep(1000);
  87.         cout << "Resets in 3s" << endl;
  88.         Sleep(1000);
  89.         cout << "Resets in 2s" << endl;
  90.         Sleep(1000);
  91.         cout << "Resets in 1s" << endl;
  92.  
  93.        
  94.        
  95.         system("cls");
  96.         cout << "Input your number grade here." << endl << endl;               
  97.     }          
  98.  
  99.     return 0;
  100. }
  101.  
  102.  
  103.  
  104. int colaMachine()
  105. {
  106.  
  107.     int colaChoice;
  108.    
  109.     cout << "Welcome to the Cola Machine!" << endl << endl;
  110.     cout << "Pick a drink:" << endl;
  111.  
  112.     cout << "[1] Coke" << endl;
  113.     cout << "[2] Pepsi" << endl;
  114.     cout << "[3] Dr. Pepper" << endl;
  115.     cout << "[4] Sprite" << endl;
  116.     cout << "[5] Root Beer" << endl << endl;
  117.  
  118.     while (100 == 100)
  119.     {
  120.         cin >> colaChoice;
  121.  
  122.         if (colaChoice == 1)
  123.             cout << "Here's some Coke!" << endl << endl;
  124.  
  125.         else if (colaChoice == 2)
  126.             cout << "Here's some Pepsi!" << endl << endl;
  127.  
  128.         else if (colaChoice == 3)
  129.             cout << "Here's some Dr. Pepper!" << endl << endl;
  130.  
  131.         else if (colaChoice == 4)
  132.             cout << "Here's some Sprite!" << endl << endl;
  133.  
  134.         else if (colaChoice == 5)
  135.             cout << "Here's some Root Beer!" << endl << endl;
  136.  
  137.         else if (colaChoice == exitC)
  138.             exit();    
  139.        
  140.         else if (colaChoice > 5 || colaChoice < 5)
  141.         {
  142.             cout << "Error. Thats not a choice!" << endl << endl;
  143.  
  144.             cout << "Resets in 5s" << endl;
  145.             Sleep(1000);
  146.             cout << "Resets in 4s" << endl;
  147.             Sleep(1000);
  148.             cout << "Resets in 3s" << endl;
  149.             Sleep(1000);
  150.             cout << "Resets in 2s" << endl;
  151.             Sleep(1000);
  152.             cout << "Resets in 1s" << endl;
  153.  
  154.             system("cls");
  155.  
  156.             colaMachine();
  157.         }
  158.  
  159.         cout << "Resets in 5s" << endl;
  160.         Sleep(1000);
  161.         cout << "Resets in 4s" << endl;
  162.         Sleep(1000);
  163.         cout << "Resets in 3s" << endl;
  164.         Sleep(1000);
  165.         cout << "Resets in 2s" << endl;
  166.         Sleep(1000);
  167.         cout << "Resets in 1s" << endl;
  168.  
  169.         system("cls");
  170.  
  171.         colaMachine();
  172.    
  173.    
  174.     }
  175.     return 0;
  176. }
  177.  
  178. int selector()
  179. {
  180.    
  181.     int choiceA;
  182.  
  183.  
  184.     cout << "Which program would you like to visit? - - - - - - - - - - You can type 101010 at any time to return to this menu." << endl << endl;
  185.  
  186.     cout << "[1] Grading System" << endl;
  187.     cout << "[2] Cola Machine" << endl << endl;
  188.  
  189.     cin >> choiceA;
  190.  
  191.     if (choiceA == 1)
  192.     {
  193.         system("cls");
  194.  
  195.         gradeSystem();
  196.     }
  197.  
  198.    
  199.     else if (choiceA > 2)
  200.     {
  201.         cout << "Error!" << endl;
  202.  
  203.         cout << "Resets in 5s" << endl;
  204.         Sleep(1000);
  205.         cout << "Resets in 4s" << endl;
  206.         Sleep(1000);
  207.         cout << "Resets in 3s" << endl;
  208.         Sleep(1000);
  209.         cout << "Resets in 2s" << endl;
  210.         Sleep(1000);
  211.         cout << "Resets in 1s" << endl;
  212.  
  213.         system("cls");
  214.  
  215.         selector();
  216.  
  217.     }
  218.  
  219.     else if (choiceA == 2)
  220.     {
  221.  
  222.        
  223.         system("cls");
  224.         colaMachine();
  225.     }
  226.     return 0;
  227.  
  228. }
  229.  
  230.  
  231.  
  232.  
  233. int main()
  234. {
  235.    
  236.     selector();
  237.    
  238.     return 0;
  239. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement