Find Jobs
Hire Freelancers

c++ program with viewable source code.

$30-250 USD

Completed
Posted almost 10 years ago

$30-250 USD

Paid on delivery
Chapter 14 & 15 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 constructor and appropriate accessors and mutators  Six overloaded relational operators that compare 2 ships. Compare based on the year the ship was built.  A virtual 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 int)  A constructor 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 constructor 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. Use the following code in your main function to test your classes: // Create an array of Ship pointers, initialized with // the addresses of some dynamically allocated objects. const int SIZE = 3; Ship *ships[SIZE] = { new Ship("Lolipop", 1960), new CruiseShip("Disney Magic", 1998, 2400), new CargoShip("Black Pearl", 1800, 50000) }; int firstShip = 0; int lastShip = 0; // Call each object's print function and check for newest and oldest. for (int index=0; index < SIZE; index++) { ships[index]->print(); cout << "----------------------------\n"; //Use overloaded relational operators if(*ships[index] < *ships[firstShip]) firstShip = index; if(*ships[index] > *ships[lastShip]) lastShip = index; } cout<<endl; cout<<"The oldest ship built was in " << ships[firstShip]->getYearBuilt() << endl; ships[firstShip]->print(); cout<<"The newest ship built was in " << ships[lastShip]->getYearBuilt() << endl; ships[lastShip]->print(); //free up the memory for (int index=0; index < SIZE; index++) { delete ships[index]; }
Project ID: 5897071

About the project

6 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
A proposal has not yet been provided
$35 USD in 1 day
0.0 (0 reviews)
0.0
0.0
6 freelancers are bidding on average $88 USD for this job
User Avatar
hello......................message me ...............i can get your work done.............i am ready to start immediately...........thnx......Best Regards
$45 USD in 2 days
4.4 (9 reviews)
2.8
2.8
User Avatar
Hi, dear. And I am a freelancer had many good experiences like your project. So Please contact me, any message. Wait for your response.
$100 USD in 1 day
5.0 (6 reviews)
2.6
2.6
User Avatar
Hello Employer! I will carry out this task in few minutes. I don't let you down. Thank you for your attention.
$40 USD in 0 day
5.0 (3 reviews)
2.4
2.4
User Avatar
Hi, I can help you with this simple task. Andrei
$30 USD in 1 day
5.0 (1 review)
2.3
2.3
User Avatar
I have 3+ experience in C++ , so i will do it easily , you can deliver the code within a day, looking forward you private message
$100 USD in 1 day
5.0 (1 review)
1.4
1.4
User Avatar
As discused in the PM, the work will be submitted on time. In 24 hours or so in c++ format. Milestone will be made
$40 USD in 1 day
4.9 (2 reviews)
1.1
1.1
User Avatar
A proposal has not yet been provided
$100 USD in 3 days
5.0 (1 review)
0.0
0.0
User Avatar
A proposal has not yet been provided
$45 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I have excellent experience in C + + programming for this simple project I would need a maximum of 3 hours, if you are interested please contact me.
$222 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Palm Coast, United States
4.8
5
Payment method verified
Member since Apr 16, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.