Question: Create the following classes: Boat ( 1 5 ) Should have the following attributes: weight, length, name Should have the method move that returns Spin

Create the following classes:
Boat (15)
Should have the following attributes: weight, length, name
Should have the method move that returns "Spin propeller"
Car(15)
Should have the following attributes: passengers, doors
Should have the method that returns "Spin wheels"
Amphibian should be a child of Boat and Car (70)
Should inherit the attributes and methods from the parent classes
Should have the additional attributes modes and
modes should consist only of 'land' and 'water'. The user should not be able to add to, change or modify these options (10)
mode should store the current mode being used (10)
Should have the method move that returns "Spin wheels" or "Spin propeller" depending on what mode the Amphibian is in. This
should be done by calling the appropiate parent class method (20)
Should have a toggle_mode method that checks mode against modes and changes mode accordingly (20)
Should have a factory method that creates an Amphibian. The user should be able to name the Amphibian (10)
Requirements:
All attributes should be properly encapsulated
Each different method of encapsulation should be used at least once
Bonus:
Make the setter so that when the user cannot change the values for:
modes (10)
mode (10)
 Create the following classes: Boat (15) Should have the following attributes:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!