subject
Engineering, 02.01.2021 06:10 Waakkaa

Ship, Cruise Ship and CargoShip Classes Design a Ship class 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 (a string) • A constructor and appropriate accessors and mutators • A virtual print function that displays the ship's name and year it was built. Design a Cruise Ship class that is derived from the Ship class. The Cruise Ship class should have the following members: • A member variable for the maximum number of passengers (an int) • A constructor and appropriate accessors and mutators • A print function that overrides the print function in the base class. The Cruise Ship class's print function should display only the ship's name and the maximum number of passengers Design a CargoShip class that si derived from the Ship class. The CargoShip class should have the following members: • A member variable for the cargo capacity in tonnage (an int). • A constructor and appropriate accessors and mutators • A print function that overrides the print function in the base class. The CargoShip class's print function should display only the ship's name and the ship's cargo capacity. Demonstrate the classes in a program that has an array of Ship pointers. Your program will read in a list of Ship, Cruise Ship and CargoShip objects from a comma delimited file (see below). The name of that file will be passed in as a command line argument. It will parse each line read and create the appropriate dynamically allocated Ship, cruise Ship or CargoShip objects. The program should then sort the array by the name of the ship. Then the program should step through the array three times, printing just the ships first, then the CargoShip's, then the Cruise Ships.

ansver
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, soreese02
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
image
Engineering, 04.07.2019 18:10, krystabrewer3
What are the two (02) benefits, which may result from a successful implementation of preventive maintenance (pm) program in an organization? (clo3)a)- lean manufacturing b)-overlapping responsibilities c)-the planner is not qualified d)-accurate contractor information e)-reduction in equipment redundancies f)-accurate stores information
Answers: 3
image
Engineering, 04.07.2019 18:10, mamasbug4285
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
image
Engineering, 04.07.2019 18:10, QueenLife4869
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
You know the right answer?
Ship, Cruise Ship and CargoShip Classes Design a Ship class that has the following members: • A memb...

Questions in other subjects:

Konu
Biology, 04.01.2022 09:40