Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PHYTON LANGUAGE 2 In preparation for the examination candidates should attempt the following practical tasks by writing and testing a program or programs. A junior

image text in transcribedPHYTON LANGUAGE

2 In preparation for the examination candidates should attempt the following practical tasks by writing and testing a program or programs. A junior park run event is held every week on a Saturday moming in a local park over a distance of two kilometres. 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 junior park run events for a year For each event, the organisers record the time each child takes to run two kilometres. 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 11 to 14. Write and test a program or programs for the park run organiser Your program or programs must include appropriate prompts for the entry of data. Error messages and other output need to be set out clearly and be understandable. All variables, arrays, constants and other identifiers must have meaningful names You will need to complete these three tasks. Each task must be fully tested TASK 1-Registering 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 name for each child is recorded and stored on registration. The PB time and the number of runs are initialised 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 program to record the unique identification number and to input the start time and finish time for every child completing the junior park run event. Calculate and store the time each 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. child took TASK 3 -Updating the children's data and identifying the fastest child for each age range Extend your program to update the number of runs and the PB time if necessary for every child pleting 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 times of the fastest child at this event for each of the age ranges 4 to 6, 7 to 10 and 11 to 14. possiblo. Every includod, bhe Permission to roasonable efort has been made by the publisher (UCLES) to trace oopyright hoidern, but it arny dams publisher will be pleased to make amonds at the eariest possible opportunity reproduce items whore third-party owned matonial protectied by copyright is incduded has been sought and cleared whore requring clearance have unwiingy beon all copyright acknowledgements are reproduced onine in the Cambrdge International to avoid the issun of disclosure of answer-colated intormation to candidates Examinatons Copyright Acknowtodgemonts Bookiet Thie is produood for each bores of examinatons and is thoely available to download at www.cien oeg uk after Cembedge mational Esaminatons Syedicate (UCLESI, which s itaolt a department of the University of Cambridge Examinations ia part of the Cambridge Assessment Group Cambridga Assossment is the brand name of Unversity of Canundze Local o UCLES 2018 0478/22/PREONT8 2 In preparation for the examination candidates should attempt the following practical tasks by writing and testing a program or programs. A junior park run event is held every week on a Saturday moming in a local park over a distance of two kilometres. 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 junior park run events for a year For each event, the organisers record the time each child takes to run two kilometres. 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 11 to 14. Write and test a program or programs for the park run organiser Your program or programs must include appropriate prompts for the entry of data. Error messages and other output need to be set out clearly and be understandable. All variables, arrays, constants and other identifiers must have meaningful names You will need to complete these three tasks. Each task must be fully tested TASK 1-Registering 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 name for each child is recorded and stored on registration. The PB time and the number of runs are initialised 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 program to record the unique identification number and to input the start time and finish time for every child completing the junior park run event. Calculate and store the time each 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. child took TASK 3 -Updating the children's data and identifying the fastest child for each age range Extend your program to update the number of runs and the PB time if necessary for every child pleting 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 times of the fastest child at this event for each of the age ranges 4 to 6, 7 to 10 and 11 to 14. possiblo. Every includod, bhe Permission to roasonable efort has been made by the publisher (UCLES) to trace oopyright hoidern, but it arny dams publisher will be pleased to make amonds at the eariest possible opportunity reproduce items whore third-party owned matonial protectied by copyright is incduded has been sought and cleared whore requring clearance have unwiingy beon all copyright acknowledgements are reproduced onine in the Cambrdge International to avoid the issun of disclosure of answer-colated intormation to candidates Examinatons Copyright Acknowtodgemonts Bookiet Thie is produood for each bores of examinatons and is thoely available to download at www.cien oeg uk after Cembedge mational Esaminatons Syedicate (UCLESI, which s itaolt a department of the University of Cambridge Examinations ia part of the Cambridge Assessment Group Cambridga Assossment is the brand name of Unversity of Canundze Local o UCLES 2018 0478/22/PREONT8

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_2

Step: 3

blur-text-image_3

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions