Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <cmath>
- #include <Windows.h>
- using namespace std;
- inline void keep_window_open() { char ch; cin >> ch; }
- int main()
- {
- char answer;
- double final_score = 0;
- cout << "1. What is 2 * 9? Please pick the correct letter answer (in lowercase) below.\n";
- cout << "\n";
- cout << " a) 14\n";
- cout << " b) 16\n";
- cout << " c) 18\n";
- cout << " d) 19\n";
- cout << " e) 23\n";
- cout << "\n";
- cin >> answer;
- cout << "\n";
- switch (answer) {
- case 'a':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'b':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'c':
- Sleep(1200);
- cout << "Correct!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- final_score++;
- break;
- case 'd':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'e':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- default:
- Sleep(1200);
- cout << "Sorry, I did not understand your answer. Please make sure you choose a letter (in lowercase).\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- }
- Sleep(1500);
- cout << "2. What is 4 * 4? Please pick the correct letter answer (in lowercase) below.\n";
- cout << "\n";
- cout << " a) 14\n";
- cout << " b) 16\n";
- cout << " c) 18\n";
- cout << " d) 19\n";
- cout << " e) 23\n";
- cout << "\n";
- cin >> answer;
- cout << "\n";
- switch (answer) {
- case 'a':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'b':
- Sleep(1200);
- cout << "Correct!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- final_score++;
- break;
- case 'c':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'd':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'e':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- default:
- Sleep(1200);
- cout << "Sorry, I did not understand your answer. Please make sure you choose a letter (in lowercase).\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- }
- Sleep(1500);
- cout << "3. What is 20 / 2? Please pick the correct letter answer (in lowercase) below.\n";
- cout << "\n";
- cout << " a) 4\n";
- cout << " b) 6\n";
- cout << " c) 9\n";
- cout << " d) 10\n";
- cout << " e) 13\n";
- cout << "\n";
- cin >> answer;
- cout << "\n";
- switch (answer) {
- case 'a':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'b':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'c':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- case 'd':
- Sleep(1200);
- cout << "Correct!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- final_score++;
- break;
- case 'e':
- Sleep(1200);
- cout << "Incorrect!\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- default:
- Sleep(1200);
- cout << "Sorry, I did not understand your answer. Please make sure you choose a letter (in lowercase).\n";
- cout << "\n";
- cout << "\n";
- cout << "\n";
- break;
- }
- cout << "\n";
- cout << "Thank you for taking the test! Your final score is " << ((final_score / 3) * 100) << "% (" << final_score << " correct answers out of 3).\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement