Question: Write the code for a constructor of class CargoShip. The tonnage should be set to 54000, the speed should be set to 0, and
Write the code for a constructor of class CargoShip. The tonnage should be set to 54000, the speed should be set to 0, and the fuel should be set to 2000000. Then a for loop should allocate memory to 10 BoxContainer Objects and add them to the vector cargo. Part 2: Write the code for a destructor of class CargoShip. The destructor should deallocate the memory from the vector cargo. Given: class BoxContainer ( }; int inventory; string contents; class CargoShip ( private: int tonnage; double speed; double fuel; vector
Step by Step Solution
There are 3 Steps involved in it
The task provided outlines the requirements for constructing and destructing a CargoShip class as we... View full answer
Get step-by-step solutions from verified subject matter experts
