Task 10 - Area trainer

The aim of this activity is to produce a computer program which will help students in year 9 practise working out the area of shapes. 

The teacher wants a way of recording when each student has used the program and so students must login to the program when they run it. The program must work in the following way:

  1. A student registers by choosing:
    1. a username
    2. and creating a password, of appropriate strength
  2. Once logged in, a menu of shapes is displayed from which the student can choose the shape they wish to practise. Shapes could include a triangle, rectangle, or circle.
  3. The dimensions of the chosen shape are displayed, along with four possible values for the area. One of the possible values is the correct answer, and the other three are incorrect.
  4. The student must choose one value for the area.
  5. The scoring must work as follows:
    1. If the student chooses the correct answer they score 2 points
    2. If they choose one of the incorrect answers, a feedback comment is displayed and they have another chance
    3. If the student chooses the correct answer this time, they score 1 point
    4. If they choose an incorrect answer again, a feedback comment is displayed together with the correct answer, and the option of answering another question, or quitting the trainer
  6. The student’s total score for the session should be recorded in an external file along with the scores from previous sessions.
  7. When quitting the trainer, the student’s total score for the current session is displayed and they are offered the following options:
    1. starting again
    2. looking at the record of their scores from their previous sessions
    3. closing the program
When creating a solution students should demonstrate their use of the following programming skills where appropriate:
  • Validation of user inputs
  • The use of random numbers
  • File input/output to handle the storage of usernames and passwords and of scores
  • Considering password strength
  • Well-designed, structured code using subroutines and interfaces
  • Error handling techniques