Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Ship cruiseship and cargoship classes c++

14/11/2020 Client: arwaabdullah Deadline: 3 days

Ship, CruiseShip, and CargoShip Classes (in C++ language i use visual studios to code with)

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 contsructor and appropriate accessors and mutators

- A virtual print function that displays the ship's name and the year it was built (nobody seems to get this part right)

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 int)

- A contsructor and appropriate accessors and mutators

- 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 tonnage (an int)

- A contsructor 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. 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.

#include "stdafx.h"//For use Visual C++ IDE //Header file section #include #include using namespace std;

//Create a Ship class class Ship { private: //A member variable for the name of the ship (a string) string name; //A member variable for the year that the ship was built (a string) string built; public: // Contsructor Ship(string n, string b) { name = n; built = b; } //accessors and mutators methods string getName() { return name; } string getBuilt() { return built; } //A virtual print function that displays //the ship's name and the year it was built virtual void print() { cout<<"Name:"<

class CruiseShip:public Ship { private: //A member variable for the maximum //number of passengers (an int) int passengers; public: // contsructor CruiseShip(string n, string y, int p) : Ship(n,y) { passengers=p; } //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. virtual void print() { cout<<"Name: "<

class CargoShip:public Ship { private: //A member variable for the cargo capacity in tonnage (an int) int tonnage; public: //Constructor CargoShip(string n, string y, int t) : Ship(n,y) { tonnage =t; } //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. virtual void print() { cout<<"Name:"<

int main() { int i; //An array of Ship pointers Ship *ships[3]={new Ship("Lolipop", "1960"), new CruiseShip("Disney Magic","2010",2400), new CargoShip("Black Pearl","2003",50000) }; //Display output for(i=0;i<3;i++) ships[i]->print();

//Pause the system for a while system("pause"); return 0; }

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Buy Coursework Help
Quality Homework Helper
Writer Writer Name Offer Chat
Buy Coursework Help

ONLINE

Buy Coursework Help

Hi dear, I am ready to do your homework in a reasonable price.

$77 Chat With Writer
Quality Homework Helper

ONLINE

Quality Homework Helper

Hi dear, I am ready to do your homework in a reasonable price.

$77 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

6x 7 1 9 2x - Australian standards for ceramic tiles - Birkbeck postgraduate degree classification - Thumbs up elbows back feet apart - Despite their benefits, traditional pyramidal management has been criticized as being ________. - Siemens 6es7 135 4fb01 0ab0 manual - Education countable or uncountable - Https www thebalance com brexit consequences 4062999 - Qm for windows linear programming download - Fence extensions mitre 10 - Overview diagram of the job costing system - Churn top and dasher - Indexed file allocation in os - Investorplace media llc lancaster pa - Similarities and differences between two countries - Mcphersons chemist broughty ferry - Mallock u2 for sale - Computer lab supervisor job description - New zealand teacher registration - Harry wong's effective classroom management model - Www agendaweb org verbs - Non defensive communication - I ate them i ate the divorce papers - Balata golf balls wiki - You have a chemical in a sealed glass container - They say i say chapter 7 exercise answers - Dr dilis clare thyroid - How would you describe sunset boards cash flows for 2014 - Apa formatted paper and PowerPoint presentation - Julie pett dog training - +91-8306951337 get your love back by vashikaran IN Udaipur - Foster a collaborative work environment - The elements of moral philosophy 9th edition pdf free - Hsc english advanced prescribed texts - Queensland health payroll system commission of inquiry - What is a vivid verb - Cultural interview paper - A dockworker loading crates on a ship - Kingsford smith drive upgrade plans - Current Liabilities - Paper 10 for Jennifer - NRS 451-VN-0501 Nursing Leadership - Life death and meaning benatar pdf - Management accounting practical questions and answers - Coppersmith global logistics reviews - Curve in residual plot - Agassi company uses a job order cost system - Production of ethanol from waste paper - The mobile crane has a weight of - Four layers of a typical state court system - Qualys severity levels 1-5 - How does gymnema tea change taste - Thomas and kilmann conflict mode instrument pdf - Care certificate standard 5 answers - Percent of nahco3 in alka seltzer - Journal Analysis: Historical Black colleges and universities - Order 2420446: Professional Development - Examples of evidence based practice assignments - Digital wwnorton com givemeliberty5sv2 - Speech about endangered animals - Informational report vs analytical report - JCCMI- Week 6 Discussion 1 and 2 - Glendale east public school - Persuasive speech outline on depression - Invitational speech outline - New Works 10/26 - In the northern hemisphere, the coriolis effect shifts objects ________ their straight-line paths. - Google site templates education - It acceptable use policy template - Community helper carpenter few lines - Totem pole lesson plan high school - Krispy kreme vision statement - A manufacturing company accumulates the following data on fixed overhead - Unit 3 using social media in business assignment - A private bushfire shelter - Why did andersen consulting change to accenture - Angels rest animal sanctuary - Sl power electronics ltd - Performance management at vitality health enterprises inc solution - Judge judy audience regulars 2018 - Sherman alexie a drug called tradition - Communicating using video conferencing and E-GROUP - Grantham university store - Aqa gcse physics equations - Toulouse lautrec post impressionism - Policies ppt - How many pages are 1200 words - Harlan fiske stone scholar - Réparation - Fables and parables example - Crucified skinhead tattoo meaning - Into thin air main events - Vehicle rental system java - A level physics formula sheet - How to present nmr data - It 210 final project case scenario - Duratec powder coat colours - Sociology 20 marker structure - Computer networking from lans to wans pdf - Sabas company has 20000 shares