Simple speed reading program

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
First of all it is still not a pseudocode. It is textual representation of algorithm where some words were changed to look like code.

Second: you did not tell what your problem is. Do you want us to help you with something? Or you want advice on architecture? Or something else?

I know this is a fairly ambitious project for a newbie
It is actually pretty simple and could be done without delving into any not-so-simple-as-they-looks topics.
For example "write line in 5 seconds or program stops and penalizes you" program is way harder.
Last edited on
I guess advice on architecture. How to best flesh out the program in C++.
I would suggest to draw a flowchart of your program ( http://en.wikipedia.org/wiki/Flowchart ). This would help in separating some self-containing parts or repeating parts of your program into functions.

After you divide your program in large parts (startup, start level input, word generation, input, check for equality, score manipulations etc.):
Think how would you generate words? (genereate word is good candidate for separate function)
Where and how would you store it?
How would you take input from user?
How would you compare your words?
What your program allows for input?
If I would accidentally separate words with two spaces, should it be error or should you allow it?
That's a really good idea. Is there any way I can create a flowchart with visio or libreoffice draw and put in the body of a forum post for you guys to look at?
Place it on any external site and post a link.
I found out that 1 second is too little for that programm: on 5 words you are essentually trying to read and remember 20 completely random letters. It would be easier it it was real words or if time was increasing depending on word amount (+1 second for each 2 words after first?)

List of header I used for this program (Most of them are not strictly nessesary, but they allows program to be shorter and look neat):
1
2
3
4
5
6
7
8
9
10
11
#include <algorithm>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <random>
#include <string>
#include <sstream>
#include <thread>
#include <vector> 
Topic archived. No new replies allowed.