Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ with comments please. Dont use the operator this and copy constructor. Please follow the instructions. Thanks in advance. No Service? 8:29 AM KHomework
In C++ with comments please. Dont use the operator this and copy constructor.
No Service? 8:29 AM KHomework 7 fractionLab.pdf Skill wt: Operator Overleading You will create a class to represent fractions and do fraction math. A fraction has a numerator and a denominator and is typically understood to look like for exanple 3/4 Typically, when we try do fraction arithmetic using a computer, we see decimal equivalen results. For example flost x1.-5, zi 7 1/5 1/5 would calculate to .4. not 2/S wouldn't ? be neeifwehad software that could actullydofract on arithmetic and provide answers in rodoced fractional form his i your las The user will ennr two fractions in the form (numcrator) then a single character (lash them anothe integer (denominator)such as 3/4 There should be no spaces in the input. Rememibar you noed to demominator cannot be All answers are displayed as a fraction inrdced foom You will write this peogram using a class called Fraction. Here is the start of the class definition class Fraction will check if the are Eaction is private //represents unerator void sirplity hote aimplify abould only be used by othez member funetLons so it is not a publie function poblie: Fraction 0: den1: //ecea trueter to s.t ? n, den; has default value /make sure to validate. set bad data to defauit values lf 0 is catered for the denominator, change it to 4ao ?ep to pr-t for invalid valas are entered) new valur Create a Fraction Cakculator that can add subtract, multiply, divide and compare fractions by adding the following member functions to your class: opezatoz //eeturns the aun of ewo fractlons opezator //eeturns the difterence of two Ezaetlons operatorreturns the prodact of two fractions opezatox/ //returns the quotient of two fractions An overloaded streas Insertion operatorss displays the data as a fraction. [note: 4/1 should print as 4. 0/8 should print as 0) An overloaded strea ext:aetion ap? at0?>> //inputs the fraetan store humerator and denominator Ovez loaded >,<.to compare fractions page i suggest you approach this problem st and test the entire at one time sten1: sme fratinns have same denaminator ieaot ith addition only do try to code on valadate courses calendar notifications inbox> Please follow the instructions.
Thanks in advance.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started