Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <string>
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.     string user, pass, apple, passi;
  9.     int score = 0, q1, con1=0, q2, con2=0, q3, con3=0, q4, con4=0, q5, con5=0, q6, con6=0, q7, con7=0, q8, con8=0, q9, con9=0, q10, con10=0;
  10.    
  11.     cout<< "Username: "; // Username and Password Checker
  12.     cin>> apple;
  13.     cout<< "Password: ";
  14.     cin>> passi;
  15.     user="ADMIN";
  16.     pass="admin";
  17.    
  18. while (user != apple || pass!=passi) {
  19.     cout << "Invalid Username and Password"<<endl;
  20.     cout << "Username: ";
  21.     cin >> apple;
  22.     cout << "Password: ";
  23.     cin >> passi;
  24. }
  25. cout << "\n-------------------------\n"
  26. << "WELCOME USER TO THE TF2 QUIZ\n"
  27. << "-------------------------\n";
  28.  
  29. do {  // Question 1
  30.     cout << "\nQuestion 1" << endl
  31.     <<  "Most Mann Co. Supply Crates list the items that are in them. At the end of the list, it says or an Exceedingly Rare Special Item! What is the exceedingly rare special item?\n"
  32.     << "\t1)Unusual Taunt\n"
  33.     << "\t2)Ususual Hat\n"
  34.     << "\t3)Usuual Weapon Skin\n"
  35.     << "\t4)Spooky Spellbook\n";
  36.    
  37.     cin >> q1;
  38.    
  39.     if (q1 == 2 ) { // Checks if answer is correct or incorrect
  40.         cout << "Correct\n";
  41.         score= score + 10;
  42.         con1++; }
  43.     else if (q1 == 1 || q1 == 3 || q1 == 4) {
  44.         cout << "Incorrect.\n";
  45.         con1++; }
  46.     else
  47.         cout << "Not a Vaild Answer";
  48. }
  49. while (con1==0); //Each question is the same except with dif Answ
  50.  
  51. do { // Question 2
  52.     cout << "\nQuestion 2" << endl
  53.     <<  "The Two Cities Update introduced two new Mann vs. Machine maps. What are they?\n"
  54.     << "\t1)Hanamora and New Mech\n"
  55.     << "\t2)Saxton and Hale\n"
  56.     << "\t3)2Fort and Viaduct\n"
  57.     << "\t4)Rottenburg and Mannhattan\n";
  58.    
  59.     cin >> q2;
  60.    
  61.     if (q2 == 4 ) {
  62.         cout << "Correct.\n";
  63.         score= score + 10;
  64.         con2++; }
  65.     else if (q2 == 1 || q2 == 3 || q2 == 2) {
  66.         cout << "Incorrect.\n";
  67.         con2++; }
  68.     else
  69.         cout << "Not a Vaild Answer";
  70. }
  71. while (con2==0);
  72.  
  73. do { // Question 3
  74.     cout << "\nQuestion 3" << endl
  75.     <<  "The Medic's signature ability is fierce and unstoppable. By using the alternate fire on the Medi Gun, the Medic can activate invulnerability for himself and his heal target. This invulnerability is known in game as a what?\n"
  76.     << "\t1)invulnerability\n"
  77.     << "\t2)Ubercharge\n"
  78.     << "\t3)The Good Stuff\n"
  79.     << "\t4)Bulletproof\n";
  80.    
  81.     cin >> q3;
  82.    
  83.     if (q3 == 2 ) {
  84.         cout << "Correct.\n";
  85.         score= score + 10;
  86.         con3++; }
  87.     else if (q3 == 1 || q3 == 3 || q3 == 4) {
  88.         cout << "Incorrect.\n";
  89.         con3++; }
  90.     else
  91.         cout << "Not a Vaild Answer";
  92. }
  93. while (con3==0);
  94.  
  95. do { // Question 4
  96.     cout << "\nQuestion 4" << endl
  97.     <<  "How many classes are in Team Fortress 2?\n"
  98.     << "\t1)Nine\n"
  99.     << "\t2)Ten\n"
  100.     << "\t3)Eight\n"
  101.     << "\t4)Eleven\n";
  102.    
  103.     cin >> q4;
  104.    
  105.     if (q4 == 1 ) {
  106.         cout << "Correct.\n";
  107.         score= score + 10;
  108.         con4++; }
  109.     else if (q4 == 2 || q4 == 3 || q4 == 4) {
  110.         cout << "Incorrect.\n";
  111.         con4++; }
  112.     else
  113.         cout << "Not a Vaild Answer";
  114. }
  115. while (con4==0);
  116.  
  117. do { // Question 5
  118.     cout << "\nQuestion 5" << endl
  119.     <<  "The Soldier can shoot a Rocket beneath his feet to propel himself into the air at the cost of some health, what is the weapon that allows him to rocket jump at the cost of no health?\n"
  120.     << "\t1)The No Damage Launcher\n"
  121.     << "\t2)The Worst Lanucher\n"
  122.     << "\t3)The Rocket Jumper\n"
  123.     << "\t4)Gotta Jump\n";
  124.    
  125.     cin >> q5;
  126.    
  127.     if (q5 == 3 ) {
  128.         cout << "Correct.\n";
  129.         score= score + 10;
  130.         con5++; }
  131.     else if (q5 == 2 || q5 == 1 || q5 == 4) {
  132.         cout << "Incorrect.\n";
  133.         con5++; }
  134.     else
  135.         cout << "Not a Vaild Answer";
  136. }
  137. while (con5==0);
  138.  
  139. do { // Question 6
  140.     cout << "\nQuestion 6" << endl
  141.     <<  "What do Strange quality weapons do?\n"
  142.     << "\t1)Counts total amount of kills\n"
  143.     << "\t2)Adds a Killstreak factor\n"
  144.     << "\t3)Adds a strange effect\n"
  145.     << "\t4)Allows customization to the weapon\n";
  146.    
  147.     cin >> q6;
  148.    
  149.     if (q6 == 1 ) {
  150.         cout << "Correct.\n";
  151.         score= score + 10;
  152.         con6++; }
  153.     else if (q6 == 2 || q6 == 3 || q6 == 4) {
  154.         cout << "Incorrect.\n";
  155.         con6++; }
  156.     else
  157.         cout << "Not a Vaild Answer";
  158. }
  159. while (con6==0);
  160.  
  161. do { // Question 7
  162.     cout << "\nQuestion 7" << endl
  163.     <<  "An alternate to his standard Shotgun, The Frontier Justice can bank guaranteed critical hits from sentry gun kills. What must happen before the Engineer can use them?\n"
  164.     << "\t1)Incresing of the Level of Sentry\n"
  165.     << "\t2)Amount of Ammo from dispensers decreases\n"
  166.     << "\t3)Number of Teleports increases\n"
  167.     << "\t4)Destroying the Sentry\n";
  168.    
  169.     cin >> q7;
  170.    
  171.     if (q7 == 4 ) {
  172.         cout << "Correct.\n";
  173.         score= score + 10;
  174.         con7++; }
  175.     else if (q7 == 2 || q7 == 3 || q7 == 1) {
  176.         cout << "Incorrect.\n";
  177.         con7++; }
  178.     else
  179.         cout << "Not a Vaild Answer";
  180. }
  181. while (con7==0);
  182.  
  183. do { // Question 8
  184.     cout << "\nQuestion 8" << endl
  185.     <<  "According to the developer commentary, what is Valve co -founder, Gabe Newell's favourite class?\n"
  186.     << "\t1)Solider\n"
  187.     << "\t2)Heavy\n"
  188.     << "\t3)Spy\n"
  189.     << "\t4)Demoman\n";
  190.    
  191.     cin >> q8;
  192.    
  193.     if (q8 == 3 ) {
  194.         cout << "Correct.\n";
  195.         score= score + 10;
  196.         con8++; }
  197.     else if (q8 == 2 || q8 == 4 || q8 == 1) {
  198.         cout << "Incorrect.\n";
  199.         con8++; }
  200.     else
  201.         cout << "Not a Vaild Answer";
  202. }
  203. while (con8==0);
  204.  
  205. do { // Question 9
  206.     cout << "\nQuestion 9" << endl
  207.     <<  "When the Sandman is equipped, how much health does the Scout have?\n"
  208.     << "\t1)100\n"
  209.     << "\t2)95\n"
  210.     << "\t3)115\n"
  211.     << "\t4)110\n";
  212.    
  213.     cin >> q9;
  214.    
  215.     if (q9 == 4 ) {
  216.         cout << "Correct.\n";
  217.         score= score + 10;
  218.         con9++; }
  219.     else if (q9 == 2 || q9 == 3 || q9 == 1) {
  220.         cout << "Incorrect.\n";
  221.         con9++; }
  222.     else
  223.         cout << "Not a Vaild Answer";
  224. }
  225. while (con9==0);
  226.  
  227. do { // Question 10
  228.     cout << "\nQuestion 10" << endl
  229.     <<  "The Pyro's Flame Thrower has a compression blast ability activated by secondary fire. It extinguishes teammates, deflects projectiles and pushes enemies. One flame thrower does not have this ability. Which one?\n"
  230.     << "\t1)Regular Flamethrower\n"
  231.     << "\t2)Phlogistinator\n"
  232.     << "\t3)The Rainblower\n"
  233.     << "\t4)Degreaser\n";
  234.    
  235.     cin >> q10;
  236.    
  237.     if (q10 == 2 ) {
  238.         cout << "Correct.\n";
  239.         score= score + 10;
  240.         con10++; }
  241.     else if (q10 == 4 || q10 == 3 || q10 == 1) {
  242.         cout << "Incorrect.\n";
  243.         con10++; }
  244.     else
  245.         cout << "Not a Vaild Answer";
  246. }
  247. while (con10==0);
  248.  
  249. cout << "\nThank you for Taking the Quiz. You got a " << score<< endl; // Shows score
  250.  
  251. switch (score) { // Gives message Depending on Grade
  252. case 100: cout << "You got a Perfect Score. Outstanding!\n";
  253.           break;
  254. case 90: cout << "Great Job! You got an A.\n";
  255.          break;
  256. case 80: cout << "Good Job. You got a B.\n";
  257.          break;
  258. case 70: cout << "Okay. You got a C.\n";
  259.          break;
  260. default:
  261.     cout << "Sorry, You have failed. Better Luck Next Time.\n"; }
  262.    
  263. return 0;
  264. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement