#include <iostream>
#include "fraction.h"
usingnamespace std;
int main()
{
fraction f1(9,8); //calling a parameterized class constructor
fraction f2(2,3); //calling a parameterized class constructor
fraction result; //calling a default class constructor
fraction f3; //calling a default class constructor
cout << "The result starts off at ";
result.print(); //calling an observer function
cout << endl;
cout << "The product of ";
f1.print();
cout << " and ";
f2.print();
cout << " is ";
result = f1.MultipliedBy(f2); //a class binary operation - function
result.print();
cout << endl;
f3 = result; //assignment
And this is my current output. The 18/24 needs to be 3/4.
The result starts off at 0/1
The product of 9/8 and 2/3 is 18/24
Process returned 0 (0x0) execution time : 0.020 s
Press any key to continue.
And if I undersrand this correctly then a is my numerator and b is my denominator but I cant just replace a with numerator and b with denominator right?