Fraction Multiply (operator*)
easyQuestion 63You are working with recipe ratios.
Create a class Fraction with two ints: numerator and denominator.
Requirements:
1) Constructor Fraction(int n, int d)
2) Getters getN() const, getD() const
3) Overload operator* to multiply two fractions and return a NEW Fraction
Note: You do NOT need to reduce/simplify the fraction. Do NOT write a main function.
Expected output
3/8= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
ClassesOperator Overloading
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.