/w10d02-HW-mbta-python

Primary LanguagePythonOtherNOASSERTION

General Assembly Logo

Python MBTA Challenge

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Fulfill the listed requirements.
  4. Be sure to do your work in challenge.js
  5. Submit your solution with pull request.

Requirements

Create a program that models a simple subway system.

  • The program takes the line and stop that a user is getting on at and the line and stop that user is getting off at and prints the total number of stops for the trip.
  • Print the stops and the lines the user will pass through to get to thier destination.

There are 3 subway lines:

The Red line has the following stops:

  red_line = south station, park st, kendall, central, harvard, porter, davis, alewife

The Green line has the following stops:

  green_line = haymarket, government center, park st, bolyston, arlington, copley

The Orange line has the following stops:

  orange_line = north station, haymarket, park st, state, downtown crossing, chinatown, back bay, forest hills

All 3 subway lines intersect at park st, but there are no other intersection points. Some of this MBTA is fictionalized. Haymarket does not connect the orange/green lines.

Hints

  • Assume good user input. Don't do lots of checking to ensure good input.

  • You should be able to try to calculate the distance in your code without user input, but in the end we'll want user input.

  • You need to prompt the user for four pieces of input data.

  • Consider diagraming the lines by sketching out the subway lines and their stops and intersection.

  • The key to the lab is to find the intersection of the lines at park st.

License

Source code distributed under the MIT license. Text and other assets copyright General Assembly, Inc., all rights reserved.