The airport has two runways - Edexcel - GCSE Computer Science - Question 8 - 2020 - Paper 1
Question 8
The airport has two runways. Each runway has a queue of planes waiting to take off. Only five planes can be queued for each runway. Other planes remain at the gates ... show full transcript
Worked Solution & Example Answer:The airport has two runways - Edexcel - GCSE Computer Science - Question 8 - 2020 - Paper 1
Step 1
8(a) Identify the parameters in the function
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The function planeQueue(pRunway, pFlight) has two parameters: pRunway and pFlight. The pRunway parameter refers to the designated runway for the plane, while the pFlight parameter is used to pass the flight details.
Step 2
8(b) Explain the call on line 35
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The call on line 35, planeQueue(runway[], flightID), matches the earlier defined function parameters. Here, runway[] corresponds to pRunway and flightID corresponds to pFlight. This ensures that the flight information is assigned to the specified runway when the function is executed.
Step 3
8(c) Detail the return value of the function
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The function is designed to return a Boolean value indicative of whether the plane was successfully added to the queue. This return value, status, signifies the success (True) or failure (False) of adding the flight to the designated runway.