Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need some help with homework! Assignment Program 12- Ship Class.pdf CIS 1202 Assignment Program 12- Ship Class Program 20 points] Create fle ShipClass.h which defines

Need some help with homework!image text in transcribed

Assignment Program 12- Ship Class.pdf CIS 1202 Assignment Program 12- Ship Class Program 20 points] Create fle ShipClass.h which defines ShipClass that has the following members: .A member variable for the name of the ship (a string) .A member variable for the year that the ship was built (an int) A constructor and appropriate set and get functions . A print function that displays the ships name and the year it was built. Create file CruiseShip.h which defines CruiseShipClass that is derived from Shipclass. The CruiseShipClass should have the following members: A member variable for the maximum number of passengers (an int) A constructor and appropriate set and get functions print function that overrides the print function in the base class. The CruiseShipClass's print function should invoke the ShipClass's print function then display the maximum number of passengers . A Create file CargoShipClass.h which defines CargoShipClass that is derived from ShipClass. The CargoShipClass should have the following members .A member variable for the cargo capacity in tonnage (an int. A constructor and appropriate set and get functions. A print function that overrides the print function in the base class. The CargoShipClass's print function should invoke the ShipClass's print function then display the ship's cargO capacity. Write a complete program that demonstrates these classes by asking the user to: 1. 2. 3. 4. 5. 6. Enter values and create a ShipClass Object Print the contents of the ShipClass object Enter values and create a CruiseShipClass Object Print the contents of the CrusieShipClass object Enter values and create a CargoShipClass Object Print the contents of the CagoShipClass object NOTE: No additional functions are needed in the main program. Access the objects through the member functions. 3/12/2015 1:25 PM Assignrment Prograrn 12-Ship Class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions