Question: For this exercise you will extend the StarShip Class created for in class exercise two. First, you will add a power plant object to the
For this exercise you will extend the StarShip Class created for in class exercise two.
First, you will add a power plant object to the StarShip (details below). This will require additional getters and setters, as well as changes to your constructors.
Next, you will create a derived class IntergalacticStarShip. An IntergalacticStarShip is a StarShip, but with the addition of an auxiliary holidome deck. The auxiliary holidome deck is measured by its available experiences count. The default value of this is 10,000. Remember to make requisite changes to the constructor and display methods
Rebuild your specification, implementation files for StarShip and add specification and implementation files for IntergalacticStarShip. Then, modify your application program (demo) to instantiate objects based on the classes you have developed. Include use of the default and parameterized constructor, getters and setters.
PowerPlant
-type:string
-thrust:double
StarShip
- starShipName : string
-maxVelocity:int
- crewSize : int
- displacement : double
-powerPlant: PowerPlant
IntergalacticStarShip
- starShipName : string
-maxVelocity:int
- crewSize : int
- displacement : double
-powerPlant: PowerPlant
-auxHolidomeExp: int
Include getters and setters, default constructor and parameterized constructor, and a display method.
Use the three file approach, header, implementation and demo.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
