Question: do not alter this driver file. my code will only output 7/3 when the exececution sample is 7/3 +1/3 = 8/3 with subtraction mulit and
do not alter this driver file. my code will only output 7/3 when the exececution sample is
7/3 +1/3 = 8/3
with subtraction mulit and division as well
#include
using namespace std;
#include "Frac2.h"
int main()
{
Fraction c(7, 3), d(3, 9), x;
// c.printFraction();
cout c;
cout " + ";
// d.printFraction();
cout d;
cout " = ";
x = c + d;
// x.printFraction();
cout x;
cout ' ';
// c.printFraction();
cout c;
cout " - ";
// d.printFraction();
cout d;
cout " = ";
x = c - d;
// x.printFraction();
cout x;
cout ' ';
// c.printFraction();
cout c;
cout " * ";
// d.printFraction();
cout d;
cout " = ";
x = c * d;
// x.printFraction();
cout x;
cout ' ';
// c.printFraction();
cout c;
cout " / ";
// d.printFraction();
cout d;
cout " = ";
x = c / d;
// x.printFraction();
cout x;
cout ' ';
// c.printFraction();
cout c;
cout " is: ";
cout ((c > d) ? " > " : " );
// d.printFraction();
cout d;
cout " according to the overloaded > operator ";
cout ((c d) ? " : " >= ");
// d.printFraction();
cout d;
cout " according to the overloaded ";
return 0;
}




\#include \#include "Frac2.h" using namespace std; Fraction : Fraction() \{ numer =0; denom =1; \} Fraction : : Fraction(int a, int b) return x; CMakelistsitit moin.cpp Frac2h Fraction : operator > (Fraction\& a) if (numer / denom a. numer / a.denom) return false; ostream\& operator 1 ) f \} cout "/" a. denom endr; ndef LABPR0J5_FRAC2_H fine LABPR0J5_FRAC2_H nolude ing namespace std; ass Fraction \{ Fraction(); Fraction(int a; int b); Fraction operator+( Fraction\& a); Fraction operator-(Fraction\& a); Fraction operator*(Fraction\& a); Fraction operator/( Fraction\& a); bool operator>(Fraction\& a); booi operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
