Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <string>
- using namespace std;
- int selector();
- int exit();
- int exitC = 101010;
- int exit()
- {
- cout << "Now going to selector" << endl; Sleep(1000);
- system("cls");
- selector();
- return 0;
- }
- int gradeSystem()
- {
- int grade = 0;
- cout << "Input your number grade here." << endl << endl;
- while (100 == 100)
- {
- cin >> grade;
- if (grade == 100)
- {
- cout << "-------------------------------------" << endl;
- cout << "-----You got a perfect score! A+-----" << endl;
- cout << "-------------------------------------\n" << endl;
- }
- else if (grade < 100 && grade >= 90)
- cout << "You got a A. Good job!\n" << endl;
- else if (grade < 90 && grade >= 80)
- cout << "You got a B. Keep up the good work!\n" << endl;
- else if (grade < 80 && grade >= 70)
- cout << "You got a C. Not good, not bad\n" << endl;
- else if (grade < 70 && grade >= 60)
- cout << "You got a D. Better luck next time!\n" << endl;
- else if (grade <= 59)
- cout << "You got a F. Are you even trying?\n" << endl;
- else if (grade == exitC)
- exit();
- else if (grade > 100 || grade < 0)
- {
- cout << "Error!" << endl << endl;
- cout << "Resets in 5s" << endl;
- Sleep(1000);
- cout << "Resets in 4s" << endl;
- Sleep(1000);
- cout << "Resets in 3s" << endl;
- Sleep(1000);
- cout << "Resets in 2s" << endl;
- Sleep(1000);
- cout << "Resets in 1s" << endl;
- system("cls");
- gradeSystem();
- }
- cout << "Resets in 5s" << endl;
- Sleep(1000);
- cout << "Resets in 4s" << endl;
- Sleep(1000);
- cout << "Resets in 3s" << endl;
- Sleep(1000);
- cout << "Resets in 2s" << endl;
- Sleep(1000);
- cout << "Resets in 1s" << endl;
- system("cls");
- cout << "Input your number grade here." << endl << endl;
- }
- return 0;
- }
- int colaMachine()
- {
- int colaChoice;
- cout << "Welcome to the Cola Machine!" << endl << endl;
- cout << "Pick a drink:" << endl;
- cout << "[1] Coke" << endl;
- cout << "[2] Pepsi" << endl;
- cout << "[3] Dr. Pepper" << endl;
- cout << "[4] Sprite" << endl;
- cout << "[5] Root Beer" << endl << endl;
- while (100 == 100)
- {
- cin >> colaChoice;
- if (colaChoice == 1)
- cout << "Here's some Coke!" << endl << endl;
- else if (colaChoice == 2)
- cout << "Here's some Pepsi!" << endl << endl;
- else if (colaChoice == 3)
- cout << "Here's some Dr. Pepper!" << endl << endl;
- else if (colaChoice == 4)
- cout << "Here's some Sprite!" << endl << endl;
- else if (colaChoice == 5)
- cout << "Here's some Root Beer!" << endl << endl;
- else if (colaChoice == exitC)
- exit();
- else if (colaChoice > 5 || colaChoice < 5)
- {
- cout << "Error. Thats not a choice!" << endl << endl;
- cout << "Resets in 5s" << endl;
- Sleep(1000);
- cout << "Resets in 4s" << endl;
- Sleep(1000);
- cout << "Resets in 3s" << endl;
- Sleep(1000);
- cout << "Resets in 2s" << endl;
- Sleep(1000);
- cout << "Resets in 1s" << endl;
- system("cls");
- colaMachine();
- }
- cout << "Resets in 5s" << endl;
- Sleep(1000);
- cout << "Resets in 4s" << endl;
- Sleep(1000);
- cout << "Resets in 3s" << endl;
- Sleep(1000);
- cout << "Resets in 2s" << endl;
- Sleep(1000);
- cout << "Resets in 1s" << endl;
- system("cls");
- colaMachine();
- }
- return 0;
- }
- int selector()
- {
- int choiceA;
- cout << "Which program would you like to visit? - - - - - - - - - - You can type 101010 at any time to return to this menu." << endl << endl;
- cout << "[1] Grading System" << endl;
- cout << "[2] Cola Machine" << endl << endl;
- cin >> choiceA;
- if (choiceA == 1)
- {
- system("cls");
- gradeSystem();
- }
- else if (choiceA > 2)
- {
- cout << "Error!" << endl;
- cout << "Resets in 5s" << endl;
- Sleep(1000);
- cout << "Resets in 4s" << endl;
- Sleep(1000);
- cout << "Resets in 3s" << endl;
- Sleep(1000);
- cout << "Resets in 2s" << endl;
- Sleep(1000);
- cout << "Resets in 1s" << endl;
- system("cls");
- selector();
- }
- else if (choiceA == 2)
- {
- system("cls");
- colaMachine();
- }
- return 0;
- }
- int main()
- {
- selector();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement