Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Subject: Advanced Algorithms Due Date: Sat 29 Sept Submit it printed in a suitable format (not written in hands) A junior park run event is

image text in transcribed
Subject: Advanced Algorithms Due Date: Sat 29 Sept Submit it printed in a suitable format (not written in hands) A junior park run event is held every week on a Saturday morning in a local park over a distance of two kilometers Children between the ages of 4 and 14 inclusive can register to take part. Children register with their name and age. When they register, they are allocated a unique identification number of four digits; the last digit is a check digit. Once registered a child can take part in the junior park run events for a year. For each event, the organizers record the time each child takes to run two kilometers. Their time is stored for every event they complete and the number of runs they have completed is updated by one. If their time is faster than their personal best (PB) time, their PB time is updated. When a child has completed 11 runs, they are awarded a half-marathon wristband. When a child has completed 22 runs, they are awarded a full-marathon wristband. A program is required to update the children's data, update PB times if necessary, and decide if a wristband is to be awarded. The program also needs to identify the fastest child at this event for each of the age ranges: 4 to 6, 7 to 10, and 1 to 14. Write and test an algorithm (pseudocode) do the following tasks: Task 1- Registration to take part Write a program to set up arrays to store the data for 20 children. On registration, each child must be allocated a unique identification number of four digits; the last digit is a check digit. The unique identification number, age in years and names for each child is recorded and stored on registration. The PB time and the number of runs are initialized to zero and these values stored on registration. Their PB time is stored as minutes correct to two decimal places. Task 2- Recording the times Extend your algorithm to record the unique identification number and to input the start time and finish time for every child completing the junior park run event.C store the time each child took to complete the run. A registered child does not have to compete in each event Only one time per child is recorded during an event. Task 3- Updating the children's data and identifying the fastest child for each age range Extend your algorithm to update the number of runs and the PB time if necessary for every child completing the junior park run event. Check if any half- or full-marathon wristbands need to be awarded. Output the names and the type of wristbands. Output the names and the time of the fastest child at this event for each of the age ranges 4 to 6, 7 to 10 and 11 to 14. Calculate and

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago