1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name;
int x;
char ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10, ch11, ch12, ch13;
cout<<"Welcome to Quiz Bee Game!\n";
cout<<"\nEnter name: ";
getline (cin, name);
cout<<"\nHello " <<name <<"! This is the First Round.\n \nGoal: Get 30 - 15 points to proceed to the next round. Correct answer: 5 points. Wrong answer: 2 points.\n";
cout<<"\n————————————————————————\n";
cout<<"\nMultiple choice: Enter answer in form of 'a', 'b' and 'c' only. \n";
cout<<"\n1.) Who designed the C++?\n \na. Bjarne Stroustrup \nb. Barne Strostrup \nc. Barney Straptrap \nAnswer: ";
cin>>ch1;
if (ch1 == 'a' || ch1 == 'A')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch1 == 'b' || ch1 == 'B')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'A'. Your score is: " <<x <<"\n";
}
else if (ch1 == 'c' || ch1 == 'C')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'A'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n2.) Who is the first programmer?\n \na. Adam Lovelace \nb. Ada Lovelace \nc. Ada Lovebug \nAnswer: ";
cin>>ch2;
if (ch2 == 'b' || ch2 == 'B')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch2 == 'a' || ch2 == 'A')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'B'. Your score is: " <<x <<"\n";
}
else if (ch2 == 'c' || ch2 == 'C')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'B'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n3.) What is an int?\n \na. Float \nb. Integer \nc. Double \nAnswer: ";
cin>>ch3;
if (ch3 == 'b' || ch3 == 'B')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch3 == 'a' || ch3 == 'A')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'B'. Your score is: " <<x <<"\n";
}
else if (ch3 == 'c' || ch3 == 'C')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'B'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n4.) What are the Boolean operators?\n \na. true and false \nb. yes and no \nc. left and right \nAnswer: ";
cin>>ch4;
if (ch4 == 'a' || ch4 == 'A')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch4 == 'b' || ch4 == 'B')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'A'. Your score is: " <<x <<"\n";
}
else if (ch4 == 'c' || ch4 == 'C')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'A'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n5.) What is the sign for Increment operator?\n \na. == \nb. -- \nc. ++ \nAnswer: ";
cin>>ch5;
if (ch5 == 'c' || ch5 == 'C')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch5 == 'a' || ch5 == 'A')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
else if (ch5 == 'b' || ch5 == 'B')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n6.) The sign for logical OR operator is? \na. && \nb. == \nc. || \nAnswer: ";
cin>>ch6;
if (ch6 == 'c' || ch6 == 'C')
{
x = x + 5;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch6 == 'a' || ch6 == 'A')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
else if (ch6 == 'b' || ch6 == 'B')
{
x = x + 2;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
if (x == 30 || x == 29 || x == 28 || x == 27 || x == 26 || x == 25 || x == 24 || x == 23 || x == 22 || x == 21 || x == 20 || x == 19 || x== 18 || x == 17 || x == 16 || x == 15){
cout<<"\nCongratulations! \nThis is the 'Final LEVEL'.\n \nGoal: Get 100 - 70 points. Correct answer: 10 points. Wrong answer: 4 points.\n";
cout<<"\n————————————————————————\n";
cout<<"\nMultiple choice: Enter answer in form of 'a', 'b' and 'c' only. \n";
cout<<"\n1.) The sign for Arithmetic operator Modulo is? \na. + \nb. * \nc. % \nAnswer: ";
cin>>ch7;
if (ch7 == 'c' || ch7 == 'C'){
x = x + 10;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch7 == 'a' || ch7 == 'A')
{
x = x + 4;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
else if (ch7 == 'b' || ch7 == 'B')
{
x = x + 4;
cout<<"Sorry, wrong answer, the answer is 'C'. Your score is: " <<x <<"\n";
}
cout<<"\n————————————————————————\n";
cout<<"\n2.) The sign that ends the statements? \na. : \nb. ; \nc. { } \nAnswer: ";
cin>>ch8;
if (ch8 == 'b' || ch8 == 'B')
{
x = x + 10;
cout<<"Good job. Your score is: " <<x <<"\n";
}
else if (ch8 == 'a' || ch8 == 'A')
{
x = x + 4;
cout<<"Sorry, wrong answer, the answer is 'B'. Your score is: " <<x <<"\n";
}
else if (ch8 == 'c' || ch8 == 'C')
{
|