Find Jobs
Hire Freelancers

c++ program with viewable source code.

$30-250 USD

Terminado
Publicado hace alrededor de 10 años

$30-250 USD

Pagado a la entrega
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]; }
ID del proyecto: 5897071

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
A proposal has not yet been provided
$35 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
6 freelancers están ofertando un promedio de $88 USD por este trabajo
Avatar del usuario
hello......................message me ...............i can get your work done.............i am ready to start immediately...........thnx......Best Regards
$45 USD en 2 días
4,4 (9 comentarios)
2,8
2,8
Avatar del usuario
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 en 1 día
5,0 (6 comentarios)
2,6
2,6
Avatar del usuario
Hello Employer! I will carry out this task in few minutes. I don't let you down. Thank you for your attention.
$40 USD en 0 día
5,0 (3 comentarios)
2,4
2,4
Avatar del usuario
Hi, I can help you with this simple task. Andrei
$30 USD en 1 día
5,0 (1 comentario)
2,3
2,3
Avatar del usuario
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 en 1 día
5,0 (1 comentario)
1,4
1,4
Avatar del usuario
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 en 1 día
4,9 (2 comentarios)
1,1
1,1
Avatar del usuario
A proposal has not yet been provided
$100 USD en 3 días
5,0 (1 comentario)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$45 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Palm Coast, United States
4,8
5
Forma de pago verificada
Miembro desde abr 16, 2014

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.