Question: You are at write a C+ program to implement an abstract data type Rational-Numbers. A Rational number has two parts, numerator and denominator. Example 1/2
You are at write a C+ program to implement an abstract data type Rational-Numbers. A Rational number has two parts, numerator and denominator. Example 1/2 and 3/5 are rational numbers. You can perform math operations on rational numbers and the results are rational numbers. The following are the operations you are to implement. Div-26 Test your code with the following data: Rational numbers a 2/5, b-13, c 1/5, d 4/12, e 3/5, f 5/2 and g 6/0 (your program should not error) Compute and output the two rational numbers and their results a+b, c* d, d/e, c-a Compute atb*f-d print results Compute da tc print results Print out 'g above Compare d b Print both operands and the results Compare e!-a Print both operands and the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
