The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Create a Ship class that has the following members:
- A field for the name of the ship ( name – String data type)
- A field for the year that the shop was built ( year – String data type)
- A constructor and appropriate gets (accessors) and sets (mutators)
- A method called toString that displays the ship ’ s name and the year it was built
Create a CruiseShip class that extends the Ship class. The CruiseShip class should have the following members:
- A field for the maximum number of passengers ( passe ngers – Integer data type)
- A constructor and appropriate gets (accessors) and sets (mutators)
- A method that overrides the toString method in the base class. The CruiseShip class’s toString method should display only the ship ’ s name and the maximum number of passengers the ship can carry.
Create a CargoShip class that extends the Ship class. The CargoShip class should have the following members:
- A field for the cargo capacity in tons ( tons – Integer data type)
- A constructor and appropriate gets (accessors) and sets (mutators)
- A method that overrides the toString method in the base class. The Cargo Ship class’s toString method should display only the ship ’ s name and the maximum number of ton s the ship can carry.