โ 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) 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 10/9
Topics:
ClassesOperator Overloading
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.