Question
Python 3 I'm asking this again so that I could get new code, not the same one as other problems so please please write your
Python 3
I'm asking this again so that I could get new code, not the same one as other problems so please please write your own code!
please dont skip over the second part. That's why I have to reask this question.
Create a class called Vehicle. This class should have instance variables for mode (land, air, water), maxPassengers (maximum number of passengers), and odometer (number of miles on the vehicle). This class should overload the string and equality operators so that the user can use print() and == with two objects of the class. Of course, your class should have a constructor that allows the user to instantiate an object and pass it all relevant information.
NEXT (second part):
create 2 subclasses of "Vehicle": Car, and Boat. These subclasses should inherit the attributes and methods of its parent class.
The Car class should include the additional attributes: make, model, color.
The Boat class should include attributes: length, and horsepower.
The two subclasses should also override the equality and string operators as you did in the parent (Vehicle) class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started