Skip to content

The-Iceburg/Area-Trainer

Repository files navigation

bannerarea

Problem: 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:

    a. a username

    b. 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:

    a. If the student chooses the correct answer they score 2 points

    b. If they choose one of the incorrect answers, a feedback comment is displayed and they have another chance

    c. If the student chooses the correct answer this time, they score 1 point

    d. 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:

    a. starting again

    b. looking at the record of their scores from their previous sessions

    c. closing the program.

Notes:

The area, a, of rectangle, which is l centimetres long by w centimetres wide is

𝑎 = 𝑙 ∗ 𝑤

The area, a, of a triangle, with a base of length b centimetres and a height of h centimetres is

𝑎 = 1/2 𝑏 ∗ ℎ

The area, a, of a circle of radius r centimetres is

𝑎 = 𝜋𝑟2

Students are free to use other shapes if they wish. It is acceptable for teachers to provide the area formulae for shapes if students require them.

When creating a solution students should demonstrate their use of the following programming skills where appropriate:

  1. Validation of user inputs

  2. The use of random numbers

  3. File input/output to handle the storage of usernames and passwords and of scores.

  4. Considering password strength

  5. Use of a graphical display (although this is not essential)

  6. Interactive program control

  7. Well-designed, structured code using subroutines and interfaces

  8. Error handling techniques.

Releases

No releases published

Packages

No packages published

Languages