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 wait in a queue unti... show full transcript
Worked Solution & Example Answer:The airport has two runways - Edexcel - GCSE Computer Science - Question 8 - 2020 - Paper 1
Step 1
a) Identify the parameters of planeQueue 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, which indicates the runway number (1 or 2), and pFlight, which represents the flight ID.
Step 2
b) Explain the return value of the planeQueue function
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 function returns a boolean value status. This indicates whether the plane was successfully added to the runway queue. If the addition is successful, status is set to true; otherwise, it remains false.
Step 3
c) Describe the invocation in line 35
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
In line 35, the function planeQueue(runway, flightID) is called, where runway represents the specific runway for which the plane is being queued, and flightID is the unique identifier assigned to the flight.