Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Help Scenario You will create world with cities, trains, and exciting journeys! This will require some proscribed class definitions. Create all the classes as

Python Help

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Scenario You will create world with cities, trains, and exciting journeys! This will require some proscribed class definitions. Create all the classes as defined below, all in your single .py file. Some of the classes build upon each other this is an example of aggregation. Many of the methods required below are very regular after you've seen one init method on this program, you've sort of seen them all. While there might be a bit more typing than usual, the amount of mental work to "solve the puzzle" should be a bit minimal once you get used to the patterns. Classes You will be writing four classes (Train, City, Journey, and TraincapacityException). Make sure you understand what these represent and how they relate to each other before continuing Train class Instance variables string the name of the train name max passengers int the maximum number of passengers the train can transport num passengers int the number of passengers currently on the train int how fast the train travels (in feet per second) speed fps Methods init (self, name, max passengers, speed fps) constructor, initializes all instance variables num passengers should default to 0 when a train is created with the constructor. o Assumptions: speed fps and max-passengers will always be a non-negative number name will be a non-empty string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

What is helping you move forward?

Answered: 1 week ago

Question

What would other people say about this situation?

Answered: 1 week ago

Question

What is stopping you from moving forward?

Answered: 1 week ago