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 09:40
Sarah is having a hard time finding a template for her advertising business that she may be able to use at a later date and also make it available to her colleagues
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. obfuscate: to make something so confusing that it is difficult to understand.
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, 05.03.2020 23:21
question
Mathematics, 05.03.2020 23:21