# 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

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 February 24, 2021, 2:36 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.19