Here is a copy of the pre-release material. DO NOT attempt Tasks 1, 2 and 3 now. Use the pre-release material and your experience from attempting the tasks before the examination to answer Question 1. Pre-release material The local high school uses buses to transport students to school. There are six bus routes labelled A to F. You have conducted a survey to analyse the punctuality statistics of these buses over a four-week period. The data from the survey are shown in the table: Punctuality table Day Bus A Bus B Bus C Bus D Bus E Bus F Mon1 0 0 2 1 -1 0 Tue1 0 1 0 0 -1 -5 Wed1 0 0 -1 0 -1 -5 Thu1 2 0 -1 0 -2 -5 Fri1 2 1 -2 0 -4 -4 Mon2 4 2 -2 0 -10 -3 Tue2 0 0 -3 0 -2 -5 Wed2 3 0 -1 0 0 0 Thu2 4 0 0 0 0 0 Fri2 -2 0 0 0 0 0 Mon3 -5 1 -2 2 0 0 Tue3 0 0 0 0 1 -2 Wed3 0 0 1 0 2 -3 Thu3 3 0 1 0 -3 1 Fri3 4 2 1 0 1 1 Mon4 -1 0 1 0 1 1 Tue4 8 0 -1 0 3 0 Wed4 1 1 -1 0 -1 0 Thu4 1 0 2 0 0 -2 Fri4 -2 0 0 0 0 -5 Positive numbers represent minutes early, negative numbers represent minutes late and 0 represents the bus having been on time. Write and test a program or programs for the local high school. • Your program or programs must include appropriate prompts for the entry of data; data must be validated on entry. • Error messages and other output need to be set out clearly and understandably. • All variables, constants and other identifiers must have meaningful names. You will need to complete these three tasks. Each task must be fully tested. Task 1 – Setting up the data storage. Using arrays set up a system to enable data for each bus route to be entered covering each day of a four-week period. It must be possible to enter the data supplied or your own set of data, using suitable prompts as necessary. Task 2 – Working out the statistics. Extend your program so that the following statistics for the four-week period may be calculated and output: • the number of late arrivals for each bus route • the average number of minutes late for each bus route • the bus route with the highest number of days on which it was late • the average number of minutes late for each bus route, using only data from days on which it was late All the results should be displayed with appropriate annotation. Task 3 – Checking specific days. Extend the program as follows: • Allow the user to input a specific day, for example Fri3, to be used for analysis of data. • Find and display how many buses were late on this particular day. • For each late bus, display the route label and how late the bus was on this particular day.
- (a)(i)State one array you used for Task 1. State the data type and purpose of this array. Array Data type Purpose[3]
- (a)(ii)State one variable you used for Task 2 and one variable you used for Task 3. In each case, state the data type and purpose of the variable. Task 2 variable name Data type Purpose Task 3 variable name Data type Purpose[6]
- (b)Write an algorithm to show how you calculated and output the number of late arrivals and the average number of minutes late for each bus route (part of Task 2), using either pseudocode, programming statements or a flowchart.[6]
- (c)Explain how your program uses the input in Task 3 to only find the data for that specific day (part of Task 3). Any programming statements used in your answer must be fully explained.[3]
- (d)Explain how you would alter your program in Task 1 to allow you to choose the number of weeks to enter data on bus arrival times.[2]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (May/June 2019). The mark or mark type is shown in brackets.
- [3] Many correct answers, the name must be meaningful. Must relate to Task 1 1 mark per bullet point e.g.1 • Array BusA • Data type integer • Purpose storing the minutes late e.g.2 • Array Day • Data type string • Purpose storing the code for the day of the week
- [6] Many correct answers, the name must be meaningful. Names shown are examples only. 1 mark per bullet point • Task 2 variable name BusAMinsLate • Data type real • Purpose used in calculation of average minutes late • Task 3 variable name SearchDay • Data type string • Purpose to input the day to be searched for
- [6] 1 mark for each point: MP1 Conditional statement to identify when a bus is late (punctuality < 0) MP2 Count the number of late days for at least one bus route MP3 Total the late minutes for at least one bus route MP4 Calculation of average minutes late 1 mark for each point (max three points): MP5 Initialisation of counting/totalling variables MP6 Iteration through days MP7 Checking all buses... MP8 Count late days and total minutes for all bus routes MP9 Output of number of late arrivals or average minutes late for at least one bus route... MP10 Output complete with all bus routes with late arrivals and average minutes late, with appropriate messages Example algorithm on next page
- [3] Explanation of how the candidate's program performed the following: Three from: MP1 The input stored as a variable MP2 The method used to find the position of the day in the Day array that matches the input MP3 The array index is stored as a variable MP4 The index variable used as the array index for each bus array MP5 ...and the contents of each array stored/output.
- [2] Two from: MP1 Add a user input and prompt to enter the number of weeks required to record data on arrival times MP2 Store the user input for number of weeks as a variable MP3 Calculation to change number of weeks to number of days MP4 Replace the upper limit of the loop with a variable MP5 Increase the maximum size of the arrays to accommodate a higher number of weeks
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →