Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <unistd.h>
- using namespace std;
- int CurrentQuestion, Done, Correct;
- string answered, ready;
- vector<string> answers {
- "A",
- "C"
- };
- vector<string> Questions {
- "Which statement is correct?",
- "What is an IF statement?"
- };
- vector<string> Aes {
- "C++ is hard.",
- "An IF statement is a checker."
- };
- vector<string> Bes {
- "C++ is easy.",
- "An IF statement is a variable that sees if a statement is true."
- };
- vector<string> Ces {
- "C++ is C#.",
- "A and B."
- };
- vector<string> Des {
- "C# is easier than Lua.",
- "None of the above."
- };
- bool CheckForGlitches() {
- for (int wowsers = 0; wowsers < answers.size(); wowsers++) {
- if (answers[wowsers] != "A" && answers[wowsers] != "B" && answers[wowsers] != "C" && answers[wowsers] != "D") {
- cout << "There is a glitch in the answers for question " << wowsers + 1 << ".\n";
- cout << "Please report it to the nearest teacher to look at the answers.";
- return true;
- }
- if (answers.size() != Aes.size() || Aes.size() != Bes.size() || Bes.size() != Ces.size() || Ces.size() != Des.size()) {
- cout << "There is a glitch by one of the teachers, one of the vector sizes \n (or known as how many answers there are) are shorter than the other\n";
- cout << "to fix this, please look at how many lines of code the Aes, Bes, Ces, Des, and if your a teacher, the answers vector.";
- return true;
- }
- }
- }
- int main() {
- if (CheckForGlitches() == true) {
- sleep(1);
- cout << " ";
- sleep(9999);
- }
- do {
- cout << "are you a teacher, student, or testor?\n";
- cout << "I am a ";
- cin >> answered;
- } while (answered != "teacher" && answered != "student" && answered != "testor");
- if (answered == "teacher") {
- cout << "Enter code: ";
- cin >> answered;
- if (answered == "5621") {
- for (int PewPew = 0; PewPew < answers.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << answers[PewPew] << "\n";
- }
- }
- } else if (answered == "student") {
- do {
- cout << "Enter E when your ready!\n";
- cin >> ready;
- } while (ready != "E" && ready != "e");
- for (int x = 0; x < answers.size(); x++) {
- do {
- for (int p = 40; p >= 0; p--) {
- cout << "\n";
- }
- CurrentQuestion++;
- cout << "Q" << CurrentQuestion << "\n";
- cout << " " << Questions[x] << "\n\n";
- cout << " A: " << Aes[x] << "\n\n";
- cout << " B: " << Bes[x] << "\n\n";
- cout << " C: " << Ces[x] << "\n\n";
- cout << " D: " << Des[x] << "\n\n";
- cout << "Answer: ";
- cin >> answered;
- if (answered == "a") {
- answered = "A";
- } else if (answered == "b") {
- answered = "B";
- } else if (answered == "c") {
- answered = "C";
- } else if (answered == "d") {
- answered = "D";
- }
- } while (answered != "A" && answered != "B" && answered != "C" && answered != "D");
- if (answered == answers[x]) {
- cout << "Correct!\n";
- Correct++;
- sleep(4);
- } else {
- cout << "Incorrect, the correct answer is: " << answers[x] << "\n";
- sleep(4);
- }
- }
- cout << "You got: " << Correct << "/" << answers.size() << "\n";
- if (Correct == answers.size()) {
- cout << "Perfect score!\n";
- sleep(3);
- }
- } else {
- cout << "Put in the code.\n";
- cout << "Input: ";
- cin >> answered;
- if (answered == ".-. .. -.-. -.- / .-. --- .-.. .-.. . -.. 61 6e 64 20 70 65 61 73 20 70 6c 65 61 73 65") {
- do {
- cout << "Hello testor, what do you want to see?\n";
- cout << " A: answers\n";
- cout << " B: Aes, Bes, Ces, Des\n";
- cout << " C: quiz itself\n";
- cout << " D: cute cat.\n";
- cout << " E: terminate.\n";
- cout << "Input: ";
- cin >> answered;
- if (answered == "A" || answered == "a") {
- for (int PewPew = 0; PewPew < answers.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << answers[PewPew] << "\n";
- }
- cin >> answered;
- } else if (answered == "B" || answered == "b") {
- "Aes:\n";
- for (int PewPew = 0; PewPew < Aes.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << Aes[PewPew] << "\n";
- }
- cout << "\n";
- "Bes:\n";
- for (int PewPew = 0; PewPew < Bes.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << Bes[PewPew] << "\n";
- }
- cout << "\n";
- "Ces:\n";
- for (int PewPew = 0; PewPew < Ces.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << Ces[PewPew] << "\n";
- }
- cout << "\n";
- "Des:\n";
- for (int PewPew = 0; PewPew < Des.size(); PewPew++) {
- cout << "Answer for question " << PewPew + 1 << " is: " << Des[PewPew] << "\n";
- }
- cout << "\n";
- cin >> answered;
- } else if (answered == "C" || answered == "c") {
- cout << "You cant answer by the way. enter anything when your ready.\n";
- cin >> answered;
- for (int x = 0; x < answers.size(); x++) {
- for (int p = 40; p >= 0; p--) {
- cout << "\n";
- }
- CurrentQuestion++;
- cout << "Q" << CurrentQuestion << "\n";
- cout << " " << Questions[x] << "\n\n";
- cout << " A: " << Aes[x] << "\n\n";
- cout << " B: " << Bes[x] << "\n\n";
- cout << " C: " << Ces[x] << "\n\n";
- cout << " D: " << Des[x] << "\n\n";
- cout << "Answer: ";
- cin >> answered;
- }
- } else if (answered == "D" || answered == "d") {
- cout << "https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab";
- cin >> answered;
- cout << "you really just got rick rolled didnt you?\n";
- sleep(3);
- cout << "cmon, the real testors would know that D stands for rick rolleD! :) \n";
- sleep(3);
- }
- } while (answered != "E" || answered != "e");
- cout << "goodbye testor.\n";
- } else {
- cout << "Wrong code, if you feel like this is wrong, go to: https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab\n";
- cout << "For more information.\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement