-
An experiment has taken place which measures the reaction speeds of students. Each student is aged from 12 to 16, and belongs to a school house (Saturn or Mars). A program is required to store the age, school house and reaction time of each student in the school. There are 650 students in the school.
-
The program should be able to output the reaction times of different student groups.
-
Write and test a program for the school.
- Your program must include appropriate prompts for the entry of data.
- Error messages and other output need to be set out clearly.
- All variables, constants and other identifiers must have meaningful names.
-
You will need to complete these three tasks. Each task must be fully tested.
- Set up one-dimensional arrays for the whole school to store the following data:
- The age of each student in whole years
- The school house of each student
- The reaction time of each student
- Input and store the records for an appropriate sample of students. Inputs must be validated on entry and any invalid inputs rejected.
- Using your sample, calculate and output the average reaction times for students in Saturn and students in Mars.
- Extend your program to prompt users to input a specific age and school house. Using only records that match the criteria input, the program should identify, calculate and output:
- The average reaction time
- The slowest reaction time
- The output should include a suitable message for each of the reaction times identified.