Please solve this question in C++
Program Description:
Design and implement an immutable Fraction Class described in the Fraction case study. Your
class must have the following methods to emulate arithmetic, relational, and I/O operations on
Fractions.
1. Arithmetic operators: + – * /
2. Relational operators: < <= > >=
3. Equality operators: == !=
4. Stream Extraction: >> (i.e. 3/7 form)
5. Stream Insertion: << (i.e. 3/7 form)
6. Method to reduce fraction
Specific Requirements:
• Your main testing program may only have two variables: start and userFraction which
are both of type Fraction.
• start should contain values set by you that are passed into the constructor.
• userFraction should start out calling the default constructor and then have its values set
through the overloaded >> operator.
• There are to be no get/set methods for the Fraction class. Having get/set methods in
your class will cause you to lose significant points.
• Note that the testing program displays the words true or false for the relational
operator testing.
Be sure to test your program with several different fractions, but for your output you report to
me, use the exact test values from the example output. Demonstrate all methods
implemented.
Helpful notes:
• You should create a .h file and two different .cpp files for this lab.
• You will not need to create a destructor.
• You may consider making a private helper function or two for simplifying your fraction.
Grading Rubric:
1. Correctness (meets specification) 5 points
2. Design (well-constructed solution) 2
3. Validation & Verification (Testing) 4
4. Style (readable for your client – me) 1
Example output:
*****Fraction Demonstration*****
We will start with the fraction 3/5
Enter a new fraction:
Numerator: 6
Denominator: 8
Your simplified fraction is: 3/4
********************************
Demonstrating overloaded math operators: -, +, *, /
This will show negation of 3/5 and then our two fractions
3/5 and 3/4 added, multiplied, and divided.
-: -3/5
+: 27/20
*: 9/20
/: 4/5
********************************
Demonstrating overloaded relational operators: <, <=, >, >=, == !=
by comparing 3/5 with 3/4.
<: true
<=: true
>: false
>=: false
==: false
!=: true
********************************
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more