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 Cruise Ship class that is derived from the Ship class. The Cruise Ship 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 Cruise Ship class’s
print function should display only the ship’s name and the maximum number of
[login to view URL] a Cargo Ship class that is derived from the Ship class. The Cargo Ship 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 Cargo Ship 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, 5000
0) };
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];
}
Hello there! I am proficient in C++ and I can provide you with the required classes and code in a few hours. I suppose that this is for a course assignment, so if you know which development environment you are using, I might be able to provide you with a project file for that too. Thank you in advance!
Best Regards
Alex
$34 USD w 1 dzień
5,0 (21 opinii)
5,2
5,2
14 freelancerzy składają oferty o średniej wysokości $45 USD dla tej pracy
Hello I have 20+ years of C++ experience, 10 years as freelancer 300+ projects completed.
· I´ll send you a full tested and documented program (in code).
· Unlimited cycles of revision in the agreed time period.
· Full advice about the best way to do the implementation.
Please contact me to discuss the details.
Thanks.
Professional C++ programmer with 4 years experience in OOP concepts and object oriented analysis
I can deliver this project in the given time with full documentation.
please contact me for more information.
I'am ready to do this Assignement now and finish it after some hours
contact me please
I'am ready to do this Assignement now and finish it after some hours
contact me please
I am available to complete this project for you. I am well-versed with the c++ language and have other colleague programmers to check the work in case I face any issues. Please choose me for your work and I will deliver the product like you've required it.
best,
Hi.
I have read and understood your requirement.
This assignment need only implement 3 classes.
Class Ship is parent. And 2 remaining class are child.
This assignment use operator, virtual method, override method and some component of OOP in C++.
I have 4 year experience working with C++.
And I believe that I am a good choice for your assignment.
This assignment is so easy, so I can complete it in 1 day.
Nice to work with you.
Thanks for your reading.
Good luck.
Hi! We are a team of Software Engineer looking for work. We are fresh here and would sincerely do the work. We have good practice for c++ programming. We all are Computer Science Engineers. We have good efficiency in HTML, CSS, Javascript, PHP , MySQL, Wordpress, Web design and development. Please give us an opportunity to prove ourself. Thank You.
experienced programmer and solving math problems , it's an easy job for me
i can work really fast, if you need this really soon, i can start to work asap.
I can do it in about 2 hours, so if you want this done ASAP, I'll get it done for you , I would have set even a lower bid but the system didn't allow me.