subject

PLS PLS PLS HELP! PL, I RLY NEED HELP In python write a code that create a class called Vehicle. Vehicle class has the following attributes:

name
make
price
It also has the following methods:
ride
_str_

The ride method returns a string “Riding vehicleName” where vehicleName is the name of the vehicle. __str__ or string method should return vehicle name, make, and price when the object is being printed. Initialize all instance variables with default parameter values, so that objects can be created without arguments as well.
Create two subclasses from the Vehicle - PoweredVehicle and Bicycle.
Bicycle has a new attribute bikeType and it could have values like mountain bike, road bike, or BMX etc. Override the __str__ method, so that the user could know the bike name, make, price, and bike type. Bicycle class should have a method called pedal. Simply return the string “Pedaling” from the method. Override the ride method by returning the value “Pedaling my bikeType” where bikeType is the type of your bicycle. You must reuse pedal method inside the ride method. Initialize the instance variables with default parameter values.
PoweredVehicle has a new attribute called registrationNumber that holds the registration number of the vehicle. Also add a method called refuel() that should return the message “Refueling vehicleName”. Replace the vehicleName with the name of the vehicle. Initialize the instance variables with default parameter values.
Create two subclasses from PoweredVehicle - Car and Ship.
Override the ride method in Car and Ship class. From the ride method, return the value “Driving my carName on the road”. Replace carName with your car name. In the ship class return the string “Sailing the shipName over the sea” from the ride method. Where shipName is the name of the ship.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 1
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
You know the right answer?
PLS PLS PLS HELP! PL, I RLY NEED HELP In python write a code that create a class called Vehicle. Ve...
Questions
question
Mathematics, 29.04.2021 06:00
question
Social Studies, 29.04.2021 06:00
question
Mathematics, 29.04.2021 06:00
question
Geography, 29.04.2021 06:00
question
Health, 29.04.2021 06:00
question
Mathematics, 29.04.2021 06:00
question
Mathematics, 29.04.2021 06:00