Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HAVE TO USE THE GIVEN CODE #ifndef FRACTION_H #define FRACTION_H #include #include #include using namespace std; class Fraction { private: long *numerator ; long *denominator;

image text in transcribed HAVE TO USE THE GIVEN CODE 
#ifndef FRACTION_H #define FRACTION_H #include  #include  #include  using namespace std; class Fraction { private: long *numerator ; long *denominator; public: long getNumerator() ; long getDenominator() ; void reduce() ; long gcd(long,long) ; // constructors Fraction() ; // default c'tor Fraction (long n) ; // create a fraction of n/1 Fraction(long n, long m) ; // Fraction n/m Fraction(Fraction & other) ; // copy c'tor ~Fraction() ; // destructor Fraction & operator=(Fraction & rhs) ; // overload assignment operator Fraction & operator+(Fraction &rhs) ; Fraction & operator-(Fraction &rhs) ; // overload binary operator - Fraction & operator-() ; // overload unary operator - (negative) Fraction & operator *(Fraction &rhs) ; Fraction & operator/(Fraction & rhs) ; Fraction & operator++() ;// overload prefix ++ Fraction & operator++(int) ; // overload postfix ++ Fraction & operator--() ;// overload prefix -- Fraction & operator--(int) ; // overload postfix -- // overload relational operators bool operator >(Fraction & rhs) ; // return true if *this > rhs , false elsewise bool operator == (Fraction & rhs) ; bool operator > (istream & in , Fraction & rhs) ; friend ostream & operator   1. Complete the implementation of the given Fraction class Notes: " You are not allowed to make any change to the given Fraction class - make sure that there is NO common factors between *numerator and *denominator  if the Fraction is negative, the negative sign always goes to *numerator , *denominator always greater than or equal to 1 . * for the output operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

Question list Question 5 Question 6 O Question 7

Answered: 1 week ago