This question is not so much related to Tristan but more so about how Grab operates. Write a Python program that tracks the drivers' salaries. Information such as the driver's name, driver ID, start location of ride, end location of ride, total distance and total cost must be outputted at the end. Driver Name and ID are constant variables, however start location of ride, end location of ride, total distance and total cost must be updated with each new ride. Your should input three test cases of your choice and screenshot all three updated outputs.
2023 / GRAB / QUESTION 22
Driver earnings
Try the question in your own editor, then check your output below.
THE QUESTION
Question by Aaleyah. Source: Girls In Code SEA — Behind the Screens, 2023, slide 39.
PRACTICE CHECK
Try your answer.
New rides for the accumulation checkpoint. Name, ID and locations still belong in the full interactive program.
Run your program in your own editor, then paste its output below. This checks the stated output or checkpoint; it does not assess your full program. Practice attempts do not affect competition scores.
Reveal worked answer
Running distance and cost
5 10 12 24 15 30
Maintain two running totals, adding each new ride: (5,10), (12,24), (15,30).