Hi everybody. I had another little quandry that I would like to get a little assistance with if possible.
I'd like to design a simple speed-reading drill program for my CS161 class. Here's what it would do.
The computer would ask the user to input an integer that would represent his skill level
After the computer takes down the skill level, it would generate a random string of 'words' which consist of random combinations of letters. Each of these 'words' would be four letters long and one would be generated for each level and displayed onscreen with a space between them. The letters would be cleared from the screen after one second.
For example, if the user entered 4, this would appear on the screen
rrlq povv xymm acqr
The random 'words' would be contained in one string. I'd also like the computer to begin a new line with every 15th word)
The program would then ask the user to input the line or paragraph of characters exactly as they appeared on the screen. If he does, he is
given the option of trying again or exiting.
Even time the user gets a correct answer, the system adds 1 to a variable which keeps score. When the score exceeds 10, the score counting variable resets to zero and the level increases by one.
I've included a brief pseudocodish algorithm below. I know this is a fairly ambitious project for a newbie, but any advice would be appreciated.
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
|
I would like the program to begin by displaying this simple prompt
int startOfProgram
{
cout << “Would you like to build on your reading skills?”;
cin >> answer;
If answer = y, Y Then run drill module
If answer = n, N Then
cout << “Goodbye>;
END
}
int drillmodule();
{
cout << “Enter level”;
int level;
cin >> level;
int scoreCounter
set set scoreCounter to 0
Create a series of four letter 'words' for each level and display them on the screen with a space between each 'word'
Store as drillString;
Clear screen after 1 second
cout << ”Please type the words displayed on screen”
cin << answerString
If answer = drillString Then
scoreCounter = scoreCounter + 1
cout << “Correct! 1 has been added to the score”
If answer does not equal drillString
set scorecounter to 0
cout << “Sorry, that answer is incorrect.”
}
char continueAnswer
cout << “Try again?”
cin continueAnswer;
If continueAnswer = y, Y Then run drillmodule again
If continueAnswer = n, N
cout << “Goodbye”;
END
| |