Find Jobs
Hire Freelancers

Help with my C++ homework!

$30-5000 USD

Selesai
Disiarkan lebih dari 20 tahun yang lalu

$30-5000 USD

Dibayar semasa penghantaran
Here is what i need: Design, code and execute a user-defined class representing rational numbers and their manipulation. Rational numbers, or fractions, consist of a whole number, a numerator, and a denominator, i.e.: 36 5/8. The class interface will be in a header file, the class implementation and the code for the main program will be in two seperate .cpp files. These file will be linked together as one executable file and then run by the CPU. A vector from the STL will be used in the program as a container for objects instead of a standard array. **_Methods_:** A default constructor that sets the default fraction values to 0,0,1 A 3 argument constructor that accepts and processes integer values for w, n, d. A one argument constructor that converts its double argument to a fraction in rational form i.e.: 62.75 converts to 62 3/4 An output method that displays fractions in the standard form w n/d An input method that read data into three data members of an object **operator = ** assignment, a shallow copy of the 3 data members **operator <<** insertion of a rational object into the output stream **operator >>** extraction of a rational object from the input stream **operator +** addition of two rational objects **operator +=** accumulation of all rational objects **operator ==** test two rational objects for equality ## Deliverables Design, code and execute a user-defined class representing rational numbers and their manipulation. Rational numbers, or fractions, consist of a whole number, a numerator, and a denominator, i.e.: 36 5/8. The class interface will be in a header file, the class implementation and the code for the main program will be in two seperate .cpp files. These file will be linked together as one executable file and then run by the CPU. A vector from the STL will be used in the program as a container for objects instead of a standard array. **Must use test data provided. Must have seperate class interfacein a header file, and implementation and code must be in two seperate .cpp files I want all source files and executable files. Must do everything provided in Methods and Program.** **_Methods_:** A default constructor that sets the default fraction values to 0,0,1 A 3 argument constructor that accepts and processes integer values for w, n, d. A one argument constructor that converts its double argument to a fraction in rational form i.e.: 62.75 converts to 62 3/4 An output method that displays fractions in the standard form w n/d An input method that read data into three data members of an object **operator = ** assignment, a shallow copy of the 3 data members **operator <<** insertion of a rational object into the output stream **operator >>** extraction of a rational object from the input stream **operator +** addition of two rational objects **operator +=** accumulation of all rational objects **operator ==** test two rational objects for equality **_Program: _** Declare a vector of 20 rational number objects using the vector object from the STL. Demonstrate assignment of objects using **operator =. **Input rational data into the vector objects using **operator >>** (see test data). Display rational numbers in standard form using **operator <<. **Add up adjacent fractions in the vecctor using **operator +,** reducing answers to lowest terms. Accumulate all fractions in the vector using **operator +=**, reducing answers to lowest terms. Tes adjacent fractions in the vector for non-equality using **operator ==**. _**Test Data: W:**_ **_N:_** **_D: _**3 4 5 66 3 8 9 1 4 13 3 4 15 3 5 29 5 6 74 5 8 4 3 7 80 1 6 80 1 6 8 8 9 52 4 5 34 0 1 2 2 5 90 5 8 10 1 3 51 17 36 78 19 36 37 3 8 ## Platform Windows 98, 2000, XP Microsoft Visual C++
ID Projek: 3029200

Tentang projek

6 cadangan
Projek jarak jauh
Aktif 20 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
See private message.
$18.70 USD dalam 5 hari
5.0 (126 ulasan)
4.7
4.7
6 pekerja bebas membida secara purata $15 USD untuk pekerjaan ini
Avatar Pengguna
See private message.
$12.75 USD dalam 5 hari
4.9 (147 ulasan)
6.5
6.5
Avatar Pengguna
See private message.
$12.75 USD dalam 5 hari
4.9 (59 ulasan)
5.1
5.1
Avatar Pengguna
See private message.
$21.25 USD dalam 5 hari
4.9 (104 ulasan)
4.9
4.9
Avatar Pengguna
See private message.
$14.45 USD dalam 5 hari
5.0 (52 ulasan)
4.9
4.9
Avatar Pengguna
See private message.
$11.05 USD dalam 5 hari
4.9 (20 ulasan)
2.8
2.8

Tentang klien

Bendera UNITED STATES
United States
4.6
3
Ahli sejak Dis 7, 2003

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.