Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started