Question: C++ Class Coding Help Design and code a class to represent rational numbers. Recall that rational numbers have a numerator and a denominator both of
C++ Class Coding Help
Design and code a class to represent rational numbers. Recall that rational numbers have a numerator and a denominator both of which come from the set of integers. Common mathematical operations on rational numbers are addition, subtraction, multiplication, division, and reciprocal: Reciprocal of A/B = B/A Sum of A/C and B/C = A + B/C Sum of A/B and C/D = A*D + C*B/B*D Difference of A/C and B/C = A - B/C Difference of A/B and C/D = A*D - C*B/B*D Product of A/B and C/D = A*C/B*D Quotient of A/B and C/D = A/B * D/C = A*D/B*C Additive Inverse of A/B = A/B = -A/B = A/-B Comparison: A/B C/D rightarrow A*D > C*B A/B greaterthanorequalto C/D rightarrow A*D greaterthanorequalto C*B A/B greaterthanorequalto C/D rightarrow A*D greaterthanorequalto C*B A/B $eq: C/D rightarrow A*D &eq: C*B A/B notequalto C/D rightarrow A*D notequalto C*BStep by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
