Design a cruiseship class that is derived from ship class

Assignment Help C/C++ Programming
Reference no: EM13311500

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.

Reference no: EM13311500

Questions Cloud

Describe a solar cell : Describe a solar cell. In your description, include the description, the efficiency of the cell and what the cell produces. Describe solar thermal energy
Find the magnitude of its angular momentum around the origin : As a 5-kg block travels around a 0.6-m radius circle it has an angular speed of 14 rad/s. find The magnitude of its angular momentum around the origin
Find out the number of carbon atoms in the compound : Determine the number of carbon atoms in the compound. Natural abundances: 12C is 98.93% and 13C is 1.07%
What is the potential difference across the capacitor : A 1.0cm * 1.0cm parallel-plate capacitor has a 2.0mm spacing. The electric field strength inside the capacitor is 1.3*10^5 V/m, What is the potential difference across the capacitor
Design a cruiseship class that is derived from ship class : SEN 970 Object-Oriented Programming in Objective-C. 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 sprinters body do you measure from the foot head or arm : If someone is running in a 100m race and you want to work out the distance the sprinter has run what part of the sprinters body do you measure from the foot head or arm
Estimate the time difference between the two atomic clocks : Two atomic clocks are synchronized while on Earth before one is launched (within a GPS satellite) into a medium-altitude Earth orbit. estimate the time difference between the two atomic clocks
Explain what is the chemical formula a non-cyclic alkane : If a non-cyclic alkane shows a molecular ion peak at m/z 2.40 × 102, what is the chemical formula
Does the environment provide opportunity : Does the environment provide opportunity for desired levels of social behavior and Can one regulate the amount of social isolation so that desired levels of privacy can be maintained?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Make a class constructor that initializes a customer

Make a class constructor that initializes a customer with a name, number, and order size.Make class member functions to print each of: name, number, and order size.

  Write a c++ program that prompts the user for a double

Write a C++ program that prompts the user for a double that should be between 0 and 100. If the value entered is outside of the interval the program will print an error message. The program should continue to repeat until the user enters an appropria..

  Write a program that fills in an array

Write a program that fills in an array, a, of 25 integers where each element contains the sum of all the previous elements plus 1, e.g., a[0] is 1 and a[3] is equal to a[0] + a[1] + a[2] + 1.

  Explain initialize variables counting the lines and letters

If the output file cannot open, exit the program. Initialize variables counting the lines and letters. Write a program that reads a given text file, outputs the text file as is, and also prints the number of lines and the number of times each lette..

  Gstring manipulation functions

Write a program that will define the followingstring manipulation functions. Each is analogous to the corresponding C++ string function.

  Write a program that plays a tic-tac-toe game.

Using functional decomposition, write a program that plays a tic-tac-toe game.

  Given the following test scores and grade equivalents

Given the following test scores and grade equivalents, write a function which is passed a score, and returns a letter grade based on the score entered. A number less than 0 or greater than 100 is invalid.

  Program to find the factors

Write a c++ program to find the factors of an integer (entered by the user) which are themselves squares.

  Write the code

Write a program that allows an instructor to keep a grade book. Each students has scores for exams, homework assignments, and quizzes.

  A robot can take steps of 1 meter

A robot can take steps of 1 meter, 2 meters, or 3 meters. Write a recursive function to calculate the number of ways the robot can walk n meters. (n is an integer obtained from user.) As example:

  Write a function named largest which will receive the array

Write a function named largest which will receive the array as input and return the variable LargestNumber.

  Write a program to calculate a person''s net pay

Write a program to calculate a person's net pay after subtracting federal income tax.The program should ask the user to enter the person's name, social security number, gross pay, and the number of dependents.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd