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

What is a statement of environmental effects - The beach a river of sand video - Overhead ground wire lightning protection - How to do poisson distribution on ti 84 - Georges manor georges hall - Medical asepsis hand washing - Ari weinzweig and paul saginaw illustrate that good leadership is - Fallacies and Judging Arguments - Write literature review and methodology for it - Romeo and juliet kissing scene in pool - All language features and meanings - Only direct quotations are documented - Ethernet frame header fields - Family tree maker companion guide - Lc-grad3 gcu - Give evidence in court crossword clue - Thematic backpack plan - Vendor management plan template - What is stock anyway answers - Hydrofluoric acid hf has a ka of 6.8 10 4 - "A" WORK POWERPOINT IN 15 HOURS or LESS - Most english bibles translate qohelet as - Platforms 1 7 manukau bus interchange putney way - Which statement is true about cost volume profit cvp analysis - Personality characteristics of a pilot - Monash mechanical engineering staff - A common size income statement for creek enterprises - Speech 1311 Chapter 5: Discussion Board and Reply to a Classmate - Journal Article - Case Study - Activity based costing - Bus 475 week 3 individual assignment - Amp life limited usi - Jk flip flop binary counter - Timed Quiz - Left right pass the gift game - Week 3 project - Sodium phosphate monobasic and dibasic buffer - Pretest posttest design example - Customer segmentation and clustering using sas enterprise miner pdf - All quiet on the western front chapter 3 summary - Battle at wounded knee movie - Bacterial id lab answers - Solver slightly paint colour - Oh now carry me to bethlehem song - Malt extract agar oxoid - Jfk umbrella man and dark complected man - Economists in the field of industrial organization study how - Dissimilar metals compatibility chart - Step response of lti system - Gram stain lab report results - Dunkin donuts operations manager job description - Assignment: Legislation Comparison Grid and Testimony/Advocacy Statement - Dulux miller mood review - Ikea vidga rail triple track - Virtual office juice plus - 11.1 resource management worksheet answer key - Redox titration of hydrogen peroxide by potassium permanganate - Edld 5311 fundamentals of leadership - Actril cold sterilant sds - REPLY - Sdlc explained with example - Terry barrett interpreting art pdf - Universal testing machine lab report - Biosecurity and bioterrorism - Glisten medication for diabetes - Danica name meaning bible - Target behavior in observable and measurable terms - Case - Auto tee up machine - The donaldson company uses a job order costing system - Modern day policing - 10 page essay compare and contrast Missouri and us constitution - Introduction on needs and wants of ancient communities - 8week4indiv - Bac evaporative condenser catalogue - A 55 kg bungee jumper leaps from a bridge - Economics for managers ppt - Precise background services whirlpool - Costco business model analysis - Which sentence's evaluative modifiers convey strong disapproval - Ernie owns a water pump - Harvard global supply chain management simulation - Eaton easy 821 dc tc manual - Unit 4 assignment - Www chemical ecology net java lat long htm - Word memo - Advantages and disadvantages of payback - Edelweiss pirates cologne 1944 - Max oxidation state of mn - Sex drugs and hiv let's get rational - C06 Online Exam 8_11 SCORE 90 Percent - Biz cafe simulation answers - MKTG201 Week 4 Discussion - BIO 101 test review questions /ASAP - As you ride the ferris wheel your distance - Shadow health abdominal assessment pdf - Bluebeam change dimension units - Restricted psv operators licence - Week3 dis eco