Home‎ > ‎Assignments‎ > ‎

Fractured Fractions

This is a very simple program to get you started with classes and objects. Create a Fraction class with data members numerator and denominator (both integers) and methods readafraction() printafraction() and convert().  In main, use a loop to read data until the sentinel value (-1), and print the fraction and the value of the fraction in decimal notation.  Use the following data:

 22 7
 10 30
 7 14
 200 100
 0 1
 0 5
 -1 
Comments