This is a version of the classic two trains meeting problem. The mathematics is well define and documented (search the web). Project #1 is fixed but Project #2 turns it into a game.
When do two trains get to CHI (Chicago)? One from LA (Los Angles) and one from NY (New York).
Calculate and display
Train #1 LA to CHI | ||
---|---|---|
2016.4 | (miles) | distance from Los Angles to Chicago |
2024-03-09T02:10:00 ISO 8601 Format (YYYY-MM-DDThh:mm:ss) | (UTC) | Departure time from LA |
55 | (mph) | average speed |
Train #2 NY to CHI | ||
789.8 | (miles) | distance from New York to Chicago |
2024-03-09T14:30:10 ISO 8601 Format (YYYY-MM-DDThh:mm:ss) | (UTC) | Departure time from NY |
35 | (mph) | average speed |
For more information about Python and UTC
Question: Why use UTC (Coordinated Universal Time) and not local time?
Create an interactive program that lets the user adjust values so the trains arrive in Chicago within 5 minutes of each other.
Use a simple menu.
Google "train speeds in America" for information on actual train speeds. Display this information to the user?
Change project #2
Convert project #2 to a GUI.
Create an interactive program that lets the user:
How about adding individual legs to each train's path (e.g. LA to Denver to Kansas City to Chicago). Different speeds on each leg?
Add metric distances and speeds to the program(s). Let the user select the units to be used/displayed. (Perhaps both?)
Animate the trip.
Assume the trains start at the same time and the train goes thru CHI and does not stop. What is the distance from LA, CHI, and NY will the trains meet?