Photo AI

A train runs from the airport to the city centre - Edexcel - GCSE Computer Science - Question 5 - 2020 - Paper 1

Question icon

Question 5

A-train-runs-from-the-airport-to-the-city-centre-Edexcel-GCSE Computer Science-Question 5-2020-Paper 1.png

A train runs from the airport to the city centre. Passengers purchase tickets from a ticket machine at the station. Journeys must start within two hours of purchasin... show full transcript

Worked Solution & Example Answer:A train runs from the airport to the city centre - Edexcel - GCSE Computer Science - Question 5 - 2020 - Paper 1

Step 1

Input: Current time

96%

114 rated

Answer

To calculate the expiry time, the current time is used as the starting point. The expiry time is then determined by adding a set duration (e.g., 2 hours) to the current time.

Step 2

Process: Calculate expiry time

99%

104 rated

Answer

The expiry time is calculated using the formula:

ExpiryTime=CurrentTime+2exthoursExpiryTime = CurrentTime + 2 ext{ hours}

This ensures that the ticket remains valid for two hours from the time of purchase.

Step 3

Output: Expiry time

96%

101 rated

Answer

The output is the calculated expiry time, which shows the time until the ticket expires, allowing passengers to plan their journey accordingly.

Step 4

Input: Payment

98%

120 rated

Answer

The payment process involves receiving coins and notes from the user. The input is validated to ensure the correct amount is received.

Step 5

Process: Ticket

97%

117 rated

Answer

Once the payment has been validated and processed, a ticket is generated and printed for the user. The machine also calculates the change to be returned based on the payment provided.

Step 6

Output: Change

97%

121 rated

Answer

The output is the amount of change that the user receives after the ticket purchase, ensuring that the transaction is completed correctly.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;