Computers and Technology
Computers and Technology, 13.06.2021 02:30, bigcm3497

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:30, jaueuxsn
Which component acts as a platform on which application software runs
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, anamatiascamaja
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
image
Computers and Technology, 23.06.2019 16:10, alexis9658
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
image
Computers and Technology, 23.06.2019 22:50, atifgujar
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
Do you know the correct answer?
PLS PLS PLS HELP! PL, I RLY NEED HELP In python write a code that create a class called Vehicle. Ve...

Questions in other subjects:

Konu
Mathematics, 09.07.2019 04:00
Konu
Mathematics, 09.07.2019 04:00