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
|
#include <iostream>
#include <windows.h>
#include <string>
int main()
{
using namespace std;
string nouns[105] = {"advice","anger","answer","apple","arithmetic","badge", "basket","basketball","battle","beast","beetle","beggar","brain","branch",};
int nounPicks, i = 0, score = 0, j;
int question[25];
string answer[25];
cout << "You will get 25 words to remember with two seconds betweeen each word generated.\nYour goal is to remember as many as you can\n\n";
cout << "Press ENTER when ready\n";
cin.get();
cout << "\n\n\n\n";
while (i != 25)
{
nounPicks = (rand() % 104);
question[i] = nounPicks;
cout << nouns[nounPicks] << endl;
Sleep(2000);
i++;
}
i = 0; //so it will print out correctly
j = 1;
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
cout << "Please enter the words in the order you saw them.";
while (i != 25)//to accomadate the incremented one before hand
{
cout << "\n" << j << ". ";
cin >> answer[i];
i++;
j++;
}
for (i = 0; i != 25; i++)
{
j = question[i];
if (answer[i] == nouns[j])
{
score++;
}
}
cout << "\nCongratualtions you are finished!";
cout << "You scored: " << score << "/" << "25";
cout << "\n\nPress ENTER to exit\n";
cin.get();
cin.get();
return 0;
}
|