← Back to Classes
Question 63
Fraction Multiply (operator*)
Fraction Multiply (operator*)
You are working with recipe ratios. Create a class Fraction with two ints: numerator and denominator. Requirements: 1) Constructor Fraction(int n, int d) 2) GettersgetN()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 — 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.