Question: Section D: LONG ANSWER [Total 30 points) 1. (15 pts] Given the following class Rational similar to the Lab 6, write the definition of the

 Section D: LONG ANSWER [Total 30 points) 1. (15 pts] Given

Section D: LONG ANSWER [Total 30 points) 1. (15 pts] Given the following class Rational similar to the Lab 6, write the definition of the friend function display. Assume that numerator and denominator are not normalized, i.e, simplified, so you will need to normalize them before display. Make sure you place the sign correctly. Assume you have already included and you can use the abs function to convert an integer to it's absolute value. Also you can assume that a function ged is defined. For example, for numerator 1 and denominator --3, it should display -1/3; and for numerator -12 and denominator -15, it should display 4/5. class Rational public: Rational): Rational(int numer, int denom): int getNumerator) int getDenominator() friend void display (ostreams ost, const Rational& rat) private int numerator; int denominator li

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!