◄Previous: 4 Using flowcharts to describe a task 2

# 5 Tasks for a typing tutor

Now here’s an example of a task that an application program called a typing tutor needs to perform. A typing tutor checks how accurately the user types certain groups of letters at the computer keyboard. For example, the group ‘asdf might have to be typed ten times as follows ‘asdf asdf asdf …’. As the user types at the keyboard, the program checks that the correct letters have been typed in each group, using space characters to define where a group ends. When the program has counted that ten groups have been entered it displays how many correct and how many incorrect groups have been typed.

The flowchart to describe this task is rather complex, so you will work through it step by step. One helpful step would be to write down a list of actions in the same manner as you did for boiling the kettle.

## Activity 3

Starting with the two actions given below, write, in order, the list of actions that need to be carried out to complete the task of the typing tutor.

- Read in a group of letters from the keyboard
- If the letters are asdf then count this as a good entry and …

(A text entry box would appear here, but your browser does not support it.)

### Discussion

A suitable list of actions would be:

- Read in a group of letters from the keyboard
- If the letters are asdf then count this as a good entry and add 1 to the total of good entries
- If the letters are not asdf then count this as a bad entry and add 1 to the total of bad entries
- Add 1 to the number of groups received
- If 10 groups have been received then send the data about performance to the display
- If 10 groups have not been received then get another group of letters

## Activity 4

Use the answer to Activity 3 to help you to produce a flowchart for implementing the task of the typing tutor. (Hint: you will not be able to use exactly the words shown above in some of the boxes of your flowchart. In particular, think carefully about how you will implement the sentences beginning with ‘if’ in the flowchart.)

Figure 5 Flowchart for Typing Tutor

The flowchart is given in Figure 5. Did you realise that the sentences that begin with ‘if’ need to be implemented as decision boxes? One of these starts two branches (depending on whether ‘asdf’ has been typed correctly) and the other a loop (to ensure that ten groups of letters are examined).

You have now seen several examples of how flowcharts can be used to describe tasks carried out by computers. Drawing such flowcharts is just one stage in the process of developing an application program. You will look at this in the next section.

◄Contents►Next: 6 Developing an application program

OpenLearn - An introduction to computers and computer systems
Except for third party materials and otherwise, this content is made available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Licence, full copyright detail can be found in the acknowledgements section. Please see full copyright statement for details.