# Write a program to do rational number arithmatic, representing each rational number as a class that has instance variables for the numerator and the denomonator

Not what you're looking for? Search our solutions OR ask your own Custom question.

Write a program to do rational number arithmatic, representing each rational number as a class that has instance variables for the numerator and the denomonator. The program should read and display all rational numbers in the format a/b, or simply a if the denominator is 1.

Â© BrainMass Inc. brainmass.com December 24, 2021, 5:09 pm ad1c9bdddfhttps://brainmass.com/computer-science/algorithms/31728

#### Solution Summary

Write a program to do rational number arithmatic, representing each rational number as a class that has instance variables for the numerator and the denomonator.

$2.49