Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string start = "";
- int score;
- int percent;
- cout << "Type 'Go' to begin the quiz, 'Help' for instructions, or 'Exit' to quit\n" << endl;
- cin >> start;
- cout << "\n" << endl;
- if (start == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- if (start == "help")
- {
- cout << "All questions require a number as an answer. Some questions ask for a one-digit answer, "
- << "and others a two-digit number. An example of a question that requires a one-digit number "
- << "as an answer could be: 1 = What colour is grass. In this case, you would type '1' to choose "
- << "this answer. Here is an example of a possible answer of a question which requires a two-"
- << "digit number as an answer: 74. Notice that there is no '=' or words, but just a number, "
- << "unlike a question that asks for a one-digit number as an answer" << endl;
- cout << "\n" << endl;
- }
- if (start == "go")
- {
- }
- {
- string q1 = "";
- score = 0;
- cout << "Question 1/16:\nWhat is Effie Trinket's favourite quote?\n\n1 = 'Let the odds be in your favour'\n"
- << "2 = 'Shall the odds be ever in your favour'\n3 = 'May the odds be ever in your favour'\n4 ="
- << " 'May the odds last forever in your favour'\n" << endl;
- cin >> q1;
- cout << "\n" << endl;
- if (q1 == "3")
- score = score + 1;
- if (q1 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q2 = "";
- cout << "Question 2/16:\nWhat district are Cato and Clove from?\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"
- << "11\n12\n" << endl;
- cin >> q2;
- cout << "\n" << endl;
- if (q2 == "2")
- {
- score = score + 1;
- }
- if (q2 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q3 = "";
- cout << "Question 3/16:\nHow many tributes are chosen each year to participate in the Hunger Games?\n\n"
- << "2\n4\n6\n8\n10\n12\n14\n16\n18\n20\n22\n24\n26\n28\n30\n" << endl;
- cin >> q3;
- cout << "\n" << endl;
- if (q3 == "24")
- {
- score = score + 1;
- }
- if (q3 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q4 = "";
- cout << "Question 4/16:\nWho is the first tribute Katniss kills directly?\n\n1 = Marvel\n2 = Glimmer\n"
- << "3 = Cato\n4 = Clove\n5 = Foxface\n6 = Thresh\n7 = Rue\n" << endl;
- cin >> q4;
- cout << "\n" << endl;
- if (q4 == "1")
- {
- score = score + 1;
- }
- if (q4 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q5 = "";
- cout << "Question 5/16:\nWhat is Prim's cat's name?\n\n1 = Furball\n2 = Honeyball\n3 = Buttercup\n4 = Lady"
- << "\n5 = Butterball\n" << endl;
- cin >> q5;
- cout << "\n" << endl;
- if (q5 == "3")
- {
- score = score + 1;
- }
- if (q5 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q6 = "";
- cout << "Question 6/16:\nHow old was Katniss when she volunteered as tribute?\n\n12\n13\n14\n15\n16\n17\n"
- << "18\n" << endl;
- cin >> q6;
- cout << "\n" << endl;
- if (q6 == "16")
- {
- score = score + 1;
- }
- if (q6 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q7 = "";
- cout << "Question 7/16:\nWhat is Gale's hunting specialty?\n\n1 = Gun\n2 = Bow & Arrow\n3 = Snares\n4 = "
- << "Machete\n" << endl;
- cin >> q7;
- cout << "\n" << endl;
- if (q7 == "3")
- {
- score = score + 1;
- }
- if (q7 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q8 = "";
- cout << "Question 8/16:\nEvery how many years does a Quarter Quell take place?\n\n5\n10\n15\n20\n25\n30\n35\n"
- << "40\n45\n50\n55\n" << endl;
- cin >> q8;
- cout << "\n" << endl;
- if (q8 == "25")
- {
- score = score + 1;
- }
- if (q8 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q9 = "";
- cout << "Question 9/16:\nWhich Hunger Games did Haymitch win? Was it a Quarter Quell?\n\n1 = 34th, No\n2 = 34th"
- << ", Yes\n3 = 48th, No\n4 = 48th, Yes\n5 = 50th, Yes\n6 = 50th, No\n7 = 52nd, No\n8 = 52nd, Yes\n9 = 54"
- << "th, No\n10 = 54th, Yes\n" << endl;
- cin >> q9;
- cout << "\n" << endl;
- if (q9 == "5")
- {
- score = score + 1;
- }
- if (q9 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q10 = "";
- cout << "Question 10/16:\nWhat is Gale's sister's name?\n\n1 = Victoria\n2 = Lily\n3 = Posy\n4 = Emily\n" << endl;
- cin >> q10;
- cout << "\n" << endl;
- if (q10 == "3")
- {
- score = score + 1;
- }
- if (q10 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q11 = "";
- cout << "Question 11/16:\nWho was Katniss's first ally in the Games?\n\n1 = Cato\n2 = Clove\n"
- << "3 = Marvel\n4 = Thresh\n5 = Rue\n6 = Glimmer\n7 = Foxface\n8 = Peeta\n" << endl;
- cin >> q11;
- cout << "\n" << endl;
- if (q11 == "5")
- {
- score = score + 1;
- }
- if (q11 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q12 = "";
- cout << "Question 12/16:\nWho did Katniss kill with the tracker jackers?\n\n1 = Peeta\n2 = Marvel\n3 = Clove\n"
- << "4 = Thresh\n5 = Cato\n6 = Rue\n7 = Foxface\n8 = Glimmer\n" << endl;
- cin >> q12;
- cout << "\n" << endl;
- if (q12 == "8")
- {
- score = score + 1;
- }
- if (q12 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q13 = "";
- cout << "Question 13/16:\nWho is the host for the Hunger Games?\n\n1 = Finnick Odair\n2 = Cinna\n"
- << "3 = Caesar Flickerman\n4 = Plutarch Heavensbee\n5 = Seneca Crane\n" << endl;
- cin >> q13;
- cout << "\n" << endl;
- if (q13 == "3")
- {
- score = score + 1;
- }
- if (q13 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q14 = "";
- cout << "Question 14/16:\nWhat is the name of Prim's goat?\n\n1 = Lady\n2 = Ivy\n3 = Buttercup\n"
- << "4 = Glimmer\n5 = Midnight\n6 = Rose\n7 = Mint\n" << endl;
- cin >> q14;
- cout << "\n" << endl;
- if (q14 == "1")
- {
- score = score + 1;
- }
- if (q14 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q15 = "";
- cout << "Question 15/16:\nWhat is the name of Peeta's stylist?\n\n1 = Plutarch\n2 = Cinna\n3 = Effie\n"
- << "4 = Portia\n5 = Haymitch\n6 = Octavia\n7 = Flavius\n" <<endl ;
- cin >> q15;
- cout << "\n" << endl;
- if (q15 == "4")
- {
- score = score + 1;
- }
- if (q15 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- string q16 = "";
- cout << "Question 16/16:\nWhat is the name of the third book in the Hunger Games trilogy?\n\n"
- << "1 = Mockingbird\n2 = Catching Fire\n3 = Victors Village\n4 = Mockingjay\n5 = Rebellion"
- << "\n6 = Hasn't been released yet\n" <<endl;
- cin >> q15;
- cout << "\n" << endl;
- if (q16 == "4")
- {
- score = score + 1;
- }
- if (q16 == "exit")
- {
- cout << "Thanks for taking the quiz! Press Enter to exit\n";
- cin.ignore();
- cin.get();
- return 0;
- }
- percent = score * 100.0 / 16;
- if (percent == 100)
- cout << "Congratulations, you got all of the answers right!\n\nPress Enter to exit" << endl;
- else
- cout << "You answered " << percent << "% ("<< score<<"/16) of questions correct!\n\nPress Enter to exit" << endl;
- cin.ignore();
- cin.get();
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment