Create a program with a .h and .cpp files with reference to the attached file.

1 answer below »
Create a program with a .h and .cpp files with reference to the attached file.
Answered Same DayMay 05, 2021

Answer To: Create a program with a .h and .cpp files with reference to the attached file.

Arun Shankar answered on May 06 2021
144 Votes
__MACOSX/._83188 solution
83188 solution/Fraction.cpp
#include
#include
us
ing namespace std;
#include "Fraction.h"
Fraction::Fraction(int _numerator, int _denominator)
{
numerator = _numerator;
denominator = _denominator;
}
double Fraction::evaluate()
{
if(denominator == 0)
return 0;
return (float)numerator / (float)denominator;
}
void Fraction::reduce()
{
if(numerator)
{
int dividend = denominator;
int divisor = numerator;
if(numerator > denominator)
{
dividend = numerator;
divisor = denominator;
}
int remainder = dividend % divisor;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here