ITCS-2530 Project
Write an interactive program that performs fractionalcalculations. You need define a class CFrac for a fractional numberaccording to the UML diagram below:
CFrac
– numerator : int
– denominator : int
– simplify () : void
+ CFrac (int = 0, int = 1)
+ ~CFrac()
+ add (const CFrac&) const : CFrac
+ subtract (const CFrac&) const : CFrac
+ multiply (const CFrac&) const : CFrac
+ divide (const CFrac&) const : CFrac
+ showFrac () const : void
+ setFrac () : void
Where the arithmetic functions perform the correspondingarithmetic calculations on the current object and the parameterobject, and return the result. The subtract function shouldsubtract the parameter object from
OR
OR