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++