Смекни!
smekni.com

Інтерактивна система навчання для вивчення англійської мови (стр. 3 из 4)

cout << " 2. Cherry&bsol;n";

cout << " 4. Magnolia&bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 2)

{

cout << goodAnswer3;

delay(3000);

correctAnswers++;

score = 300;

}

if (yourAnswer != 2)

{

cout << badAnswer3;

delay(3000);

score = 0;

walkAway();

}

}

void answer4()

{

clrscr();

cout << question1;

cout << "1. A = B + C &bsol;n";

cout << " 4. A = C &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 4)

{

cout << goodAnswer4;

delay(3000);

correctAnswers++;

score = 500;

}

if (yourAnswer != 3)

{

cout << badAnswer4;

delay(3000);

score = 0;

walkAway();

}

}

void answer5()

{

clrscr();

cout << question5;

cout << "1. 600 &bsol;n";

cout << "3. 300 &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 1)

{

cout << goodAnswer5;

delay(3000);

correctAnswers++;

score = 1000;

}

if (yourAnswer != 1)

{

cout << badAnswer5;

delay(3000);

score = 0;

walkAway();

}

}

void answer6()

{

clrscr();

cout << question6;

cout << "1. Lassie 2. Old Yeller&bsol;n";

cout << " &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 1)

{

cout << goodAnswer6;

delay(3000);

correctAnswers++;

score = 2000;

}

if (yourAnswer != 1)

{

cout << badAnswer6;

delay(3000);

score = 1000;

walkAway();

}

}

void answer7()

{

clrscr();

cout << question7;

cout << "1. Jerry Lee Lewis &bsol;n";

cout << " 4. Elvis Presley&bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 4)

{

cout << goodAnswer7;

delay(3000);

correctAnswers++;

score = 4000;

}

if (yourAnswer != 1)

{

cout << badAnswer7;

delay(3000);

score = 1000;

walkAway();

}

}

void answer8()

{

clrscr();

cout << question8;

cout << " 2. Mark Twain&bsol;n";

cout << " 4. Edward Furlong&bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 2)

{

cout << goodAnswer8;

delay(3000);

correctAnswers++;

score = 8000;

}

if (yourAnswer != 2)

{

cout << badAnswer8;

delay(3000);

score = 1000;

walkAway();

}

}

void answer9()

{

clrscr();

cout << question9;

cout << "1. Black 2. Temple&bsol;n";

cout << " &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 1)

{

cout << goodAnswer9;

delay(3000);

correctAnswers++;

score = 16000;

}

if (yourAnswer != 1)

{

cout << badAnswer9;

delay(3000);

score = 1000;

walkAway();

}

}

void answer0()

{

clrscr();

cout << question0;

cout << "1. Gilbert Blithe &bsol;n";

cout << "3. Sedrick Smith &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 3)

{

cout << goodAnswer0;

delay(3000);

correctAnswers++;

score = 32000;

}

if (yourAnswer != 3)

{

cout << badAnswer0;

delay(3000);

score = 1000;

walkAway();

}

}

void answer01()

{

clrscr();

cout << question01;

cout << " 2. Black&bsol;n";

cout << "3. Red &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 3)

{

cout << goodAnswer01;

delay(3000);

correctAnswers++;

score = 64000;

}

if (yourAnswer != 3)

{

cout << badAnswer01;

delay(3000);

score = 32000;

walkAway();

}

}

void answer02()

{

clrscr();

cout << question02;

cout << "1. Brown &bsol;n";

cout << "3. White &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 1)

{

cout << goodAnswer02;

delay(3000);

correctAnswers++;

score = 125000;

}

if (yourAnswer != 1)

{

cout << badAnswer02;

delay(3000);

score = 32000;

walkAway();

}

}

void answer03()

{

clrscr();

cout << question03;

cout << " &bsol;n";

cout << "3. 1025 4. 1015&bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 4)

{

cout << goodAnswer03;

delay(3000);

correctAnswers++;

score = 250000;

}

if (yourAnswer != 4)

{

cout << badAnswer03;

delay(3000);

score = 32000;

walkAway();

}

}

void answer04()

{

clrscr();

cout << question04;

cout << " 2. Nancy Cartwright&bsol;n";

cout << "3. Nancy Drew &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 2)

{

cout << goodAnswer04;

delay(3000);

correctAnswers++;

score = 500000;

}

if (yourAnswer != 2)

{

cout << badAnswer04;

delay(3000);

score = 32000;

walkAway();

}

}

void answer05()

{

clrscr();

cout << question05;

cout << "1. Christopher Reeves &bsol;n";

cout << "3. George Reeves &bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 3)

{

cout << goodAnswer05;

delay(3000);

correctAnswers++;

score = 1000000;

}

if (yourAnswer != 3)

{

cout << badAnswer05;

delay(3000);

score = 32000;

walkAway();

}

}

// End of 50/50 functions

int walkAway() // Decides how the program will end

{

delay(3000); // Pauses for 3 seconds

if (correctAnswers >= 1 && correctAnswers < 15)

{

cout << "&bsol;n&bsol;n" << yourName <<", you answered " << correctAnswers << "&bsol;n"; // Prints how many questions answered of

cout << "out of " << counter << " attempted questions.&bsol;n"; // how many attempted to the screen

cout << "You've won " << "$" << score << "!";

}

if (correctAnswers < 1) // Executes if correctAnswers is less than 1

{

cout << "&bsol;n&bsol;nOh well, maybe next time.&bsol;n&bsol;n"; // Prints to screen

score = 0;

cout << "You won " << "$" << score << ". :( &bsol;n&bsol;n";

}

if (correctAnswers == 15) // Executes if correctAnswers is equivalent to 10

{

while (counter2 < 10)

{

counter2++;

clrscr();

delay(300);

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

cout << "1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000 1,000,000&bsol;n";

delay(300);

clrscr();

delay(300);

counter2++; // Increases counter2 by one

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&bsol;n";

delay(300);

clrscr();

delay(300);

}

cout << "Congradulations, " << yourName << ".&bsol;n";

cout << "You've won $1,000,000!!!&bsol;n&bsol;n";

}

cout << "&bsol;n&bsol;nTaken from Television Series 'Who Wants To Be A Millionaire'&bsol;n"; // Prints to screen

cout << "Programmed by Gordon C. December 2001&bsol;n&bsol;n"; // in any case

return 0;

}

void continueProgram() // Gives user option to continue or quit

{

delay(5000);

clrscr(); // Clears the screen

cout << "Please enter your FIRST name ONLY: ";

cin >> yourName;

delay(500);

clrscr();

cout << "Hello, " << yourName << ". Welcome to...&bsol;n";

delay(2000);

cout << "3. 1025 4. 1015&bsol;n";

cout << numberOfAnswer;

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 4)

{

cout << goodAnswer03;

delay(3000);

correctAnswers++;

score = 250000;

}

if (yourAnswer == 1 || yourAnswer == 2 || yourAnswer == 3)

{

cout << badAnswer03;

delay(3000);

score = 32000;

walkAway();

return 0;

}

if (yourAnswer == 5)

{

if (fiftyFiftyUsed == 1)

{

cout << "&bsol;nSorry 50/50 has already been used!&bsol;n";

delay(3000);

clrscr();

goto loop02;

}

if (fiftyFiftyUsed != 1)

{

fiftyFiftyUsed = 1;

answer03();

if (yourAnswer != 4)

{

score = 32000;

return 0;

}

}

}

if (yourAnswer == 6)

{

if (phoneFriendUsed == 1)

{

cout << "Sorry, phone a friend has been used!&bsol;n";

delay(3000);

clrscr();

goto loop02;

}

if (phoneFriendUsed != 1)

{

phoneFriendUsed = 1;

delay(2000);

cout << "Dialing...&bsol;n";

delay(2000);

cout << "You have been connected to " << people03 << ".&bsol;n";

cout << people03 << ",&bsol;n" << question03 << "&bsol;n";

cout << "1. 1035 2. 1075&bsol;n";

cout << "3. 1025 4. 1015&bsol;n";

delay(2000);

cout << "&bsol;n&bsol;n" << people03 << ": " << "I'm no math expert. I couldn't tell ya. Sorry.&bsol;n";

cout << numberOfAnswer2;

cin >> yourAnswer;

if (yourAnswer == 4)

{

cout << goodAnswer03;

delay(3000);

correctAnswers++;

score = 250000;

}

if (yourAnswer != 4)

{

cout << badAnswer03;

delay(3000);

score = 32000;

walkAway();

return 0;

}

if (yourAnswer == 7)

{

score = 32000;

walkAway();

return 0;

}

if (yourAnswer < 1 || yourAnswer > 7)

{

cout << badAnswer03;

delay(3000);

score = 32000;

walkAway();

return 0;

}

}

}

if (yourAnswer == 7)

{

score = 32000;

walkAway();

return 0;

}

if (yourAnswer != 1 && yourAnswer != 2 && yourAnswer != 3 && yourAnswer != 4 && yourAnswer != 5 && yourAnswer != 6 && yourAnswer != 7)