Find Jobs
Hire Freelancers

I need a c++ program built with viewable source code

$30-250 USD

Berlangsung
Dibuat sekitar 10 tahun yang lalu

$30-250 USD

Dibayar ketika dikirim
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 Proyek: 5834532

Tentang proyek

4 proposal
Proyek remot
Aktif 10 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
4 freelancer menawar dengan rata-rata $80 USD untuk pekerjaan ini
Avatar Pengguna
hi, client. i am interested in your job. i have excellent c++ programming skill and this is very simple for me. i am sure i can help you. please give me this job. jixing.
$111 USD dalam 0 hari
4,8 (9 ulasan)
4,0
4,0
Avatar Pengguna
I am specialize in C++,C#.net,ASP.Net,JAVA, PHP, MySQL, Wordpress, e-commerce websites and portals, payment gateways and customized web based applications. my aim to deliver quality products to our customers within specified deadline. If hired by you I will put in my best work. I am ready to be hired by you and start work on your jobs. CHECK MY PROFILE AND REVIEWS PM to me for more discussion
$115 USD dalam 2 hari
5,0 (2 ulasan)
3,6
3,6
Avatar Pengguna
A proposal has not yet been provided
$50 USD dalam 5 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
I'm a Software Engineer from Singapore. I believe I can finish your task quickly and meet your demand. Please drop me a message, thank. I'll be glad to help you solve your problem~~
$45 USD dalam 3 hari
0,0 (0 ulasan)
0,0
0,0

Tentang klien

Bendera UNITED STATES
Palm Coast, United States
4,8
5
Memverifikasi Metode pembayaran
Anggota sejak Apr 16, 2014

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.