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
|
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
string Questions[11] = {"Who was the first U.S.A President? ", "Which protozoan group consists of all parasites? ", "Who was the first man to go on the moon? ",
"What is the real name of the lead guitarist in Guns N' Roses? ", "Who led the attack on the Twin Towers on 9/11? ", "What band sang the song 'Dream On'? ",
"Who made the lightbulb? ", "Which president is on the $20 bill? ", "Which nucleotide is in mRNA but not in DNA? ", "Which war was first to be televised? ",
"Which of the following did NOT happen during the Great Depression? "};
string Choices1[11] = {"Abraham Lincoln", "Endospores", "Louis Armstrong", "Slash", "Muhammad Hossain", "ACDC", "Albert Einstein", "George Bush",
"Thymine", "Cold War", "Bank closures"};
string Choices2[11] = {"Obama", "Skeptozoan", "Chuck Norris", "Angus Young", "Muhammad Ali", "Iron Maiden", "Aristotle", "Theodore Roosevelt", "Adenine", "Civil War", "Unemplloyment"};
string Choices3[11] = {"John Adams", "Diatoms", "Bruce Lee", "Paul Johnson", "Al Qaeda", "Pillar", "Stephan Hawking", "John Adams", "Guanine", "Japanese War", "Lose of confidence"};
string Answers[11] = {"George Washington", "Sporozoan", "Neil Armstrong", "Saul Hudson", "Osama Bin Laden", "Aerosmith", "Thomas Edison",
"Andrew Jackson", "Uracil", "Vietnam War", "Disease spread"};
string UserAnswer;
char Continue;
int Money = 0;
ofstream Choices;
Choices.open("Millionaire.txt", ios::app);
cout << "Welcome to the Millionaire Game!!!" << endl << endl;
for(int x = 0; x < 11; x++)
{
Choices << Questions[x] << endl;
Choices << "A) " << Choices1[x] << endl;
Choices << "B) " << Choices2[x] << endl;
Choices << "C) " << Choices3[x] << endl;
Choices << "D) " << Answers[x] << endl;
}
Continue = 'C';
while(Continue == 'C')
{
cout << Questions[0] << endl;
cout << "A) " << Choices1[0] << endl;
cout << "B) " << Choices2[0] << endl;
cout << "C) " << Choices3[0] << endl;
cout << "D) " << Answers[0] << endl;
cout << "Enter your answer (A, B, C, or D): ";
cin >> UserAnswer;
if(UserAnswer == "D")
{
cout << "Correct!" << endl;
Money = 1000;
cout << "You know have $" << Money << "!" << endl << endl;
}
else
{
cout << "Incorrect!" << endl;
cout << "You have lost the game." << endl << endl;
break;
}
cout << "Do you want to continue or walk away (C/W)? ";
cin >> Continue;
Choices << Questions[1] << endl;
Choices << "A) " << Choices2[1] << endl;
Choices << "B) " << Answers[1] << endl;
Choices << "C) " << Choices3[1] << endl;
Choices << "D) " << Choices1[1] << endl;
cout << "Enter your answer (A, B, C, or D): ";
cin >> UserAnswer;
if(UserAnswer == "D")
{
cout << "Correct!" << endl;
Money = 1000;
cout << "You know have $" << Money << "!" << endl << endl;
}
else
{
cout << "Incorrect!" << endl;
cout << "You have lost the game." << endl << endl;
break;
}
cout << "Do you want to continue or walk away (C/W)? ";
cin >> Continue;
}
cout << "You have won $" << Money << endl;
cout << "See you next time!" << endl << endl;
system("PAUSE");
return 0;
}
|