In this exercise, we'll model the behavior of an U-Bahn or S-Bahn train.
Given a route which provides stations (just strings), the train's current station, and whether or not it's traveling in reverse (i.e., from the last stop to the first stop), the train should complete the route in the correct direction.
When the train's complete_route
method is called, it should print a summary
of the stops to standard output. The first line should announce the route and
where it's headed. The following lines should list the stations traveled to.
After the last stop, print "Endbahnhof" to signal the end of the route.
Here's a complete example of the expected output for the U8 route from Wittenau to Hermannstraße, starting from Schönleinstraße and traveling in the forward direction.
U8 Richtung Hermannstrasse
Hermannplatz
Boddinstrasse
Leinestrasse
Hermannstrasse
Endbahnhof