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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, blackjack73
3. (6 pts) internally in the computer, with few exceptions, all numerical computation is done using binary numbers. output, however, often uses ascii, which is formed by appending 011 to the left of a bcd code. thus, an algorithm that directly converts a binary integer to a bcd integer is very useful. here is one such algorithm 1) draw lines to the left of the binary number to bound the expected bcd decades. (each decade is a group of 4 bits.) move the binary number one bit to the left. add 0011 to each bcd decade containing a binary value> 0100 repeat steps 2-3 until the last bit in the binary number has been moved into the least significant decade position. (note that when the last bit has been shifted into bcd decade, step 3 is not repeated.) read the bcd result. 2) 3) 4) 5) a) execute the algorithm for the binary number 1101101 b) execute the algorithm for the binary number 01110101110 4. (4 pts) represent the decimal number 3568 in bcd; excess-3 code; ascil; and hex.
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, hernandez09297
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
image
Computers and Technology, 23.06.2019 12:30, legend101xD
Animations and transitions are added from the
Answers: 1
image
Computers and Technology, 23.06.2019 12:30, umimgoingtofail
What is the difference between the internet and the world wide web?
Answers: 1
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 in other subjects: