Skip to content
Skip to main content

About this free course

Download this course

Share this free course

An introduction to computers and computer systems
An introduction to computers and computer systems

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

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 _unit7.6.1 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 …
To use this interactive functionality a free OU account is required. Sign in or register.
Interactive feature not available in single page view (see it in standard view).

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 _unit7.6.2 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.)

The steps in the flowchart are as follows: Start; Read in group of letters from keyboards; Is group ‘asdf’? If yes: Add 1 to tally of good entries and if no: Add 1 to tally of bad entries; Add 1 to tally of groups received; If yes: Have 10 groups been received? Send data about performance to display; End and if no: back to the start.
Figure _unit7.6.1 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.