The long-stay parking at the airport uses a variable rate charging system - Edexcel - GCSE Computer Science - Question 2 - 2020 - Paper 1
Question 2
The long-stay parking at the airport uses a variable rate charging system.
Here is the pseudocode for this algorithm.
SEND "Welcome to airport parking" TO DISPL... show full transcript
Worked Solution & Example Answer:The long-stay parking at the airport uses a variable rate charging system - Edexcel - GCSE Computer Science - Question 2 - 2020 - Paper 1
Step 1
IF (days > 8) THEN
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
In this case, if the number of days exceeds 8, the cost is calculated as:
cost=55+10imes(days−8).
Step 2
ELSE IF (days > 6) THEN
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
If the stay is more than 6 but 8 or less, the cost is set directly to 55.
Step 3
ELSE IF (days > 3) THEN
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
If the stay is over 3 but 4 to 6, the cost is set to 45.
Step 4
ELSE
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
For stays of 3 days or less, the cost is set to 25.