Sen 970 object-oriented programming in objective-c


Question 1)

Instructions: Ships, CruiseShip, and CargoShip Classes

Design a Ship class that has the following members:

• A member variable for the name of the shop (a string).
• A member variable for the year that the ship was built (a string).
• An initializer and appropriate accessor and mutators using any technique you want.
• A print function that displays the ship's name and the year it was built.

Design a CruiseShip Class that is derived from the Ship class. The CruiseShip class should have the following members:

• A member variable for the maximum number of passengers (an integer)
• An initializer and appropriate accessor and mutators using any technique you want.
• A print function that overrides the print function in the base class. The CruiseShip class's print function should display only the ship's name and the maximum number of passengers.

Design a CargoShip class that is derived from the Ship class. The CargoShip class should have the following members:

• A member variable for the cargo capacity in tons (an integer)
• An initializer and appropriate accessor and mutators using any technique you want.
• 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. The array elements should be initialized with the addresses of dynamically allocated Ship, CruiseShip and CargoShip objects. The program should then step through the array, calling each object's print function.

Question 2)

Project Description:

Create a GUI based application of your choice. This is your opportunity to create your own application that runs on OSX. Do NOT create an iOS (iPhone/iPad) mobile device app, this needs to be a traditional style Mac application that runs on OSX, any version (not mobile device).

Use multiple Objective-C classes that demonstrate concepts of inheritance as well as other object-oriented concepts presented in this class. Be creative and expressive. Create something you can be proud of and maybe use in the future.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Sen 970 object-oriented programming in objective-c
Reference No:- TGS0650183

Now Priced at $40 (50% Discount)

Recommended (91%)

Rated (4.3/5)