07-10-2011, 06:25 PM
|
| Little Baby | | Join Date: Sep 2011 Location: Karachi
Posts: 3
Program / Discipline: BSCS Class Roll Number: 07-20 | |
how to make four fraction calculator in c++ using classes and operator overloading
well, I ave this object as assignment. If anybody know how to make it, please tell me. I have to submit it by 10/10/2011.
object:: 1. Create a class called Fraction. Its data members are numerator, denominator, fraction_value, slash, whole_number. Fraction_value: stores the fraction decimal value. Slash: ("/"): is common to all Fraction objects, and will be used for a formatted display. A constructor accepts two integer values. If only one parameter is passed, then assign it to the numerator, and force denominator to be 1. If no parameter is passed, use zero for the numerator and one for the denominator. A constructor that accepts 3 arguments: a whole number portion of the fraction, a numerator, and a denominator. If it is the case, compute the whole number and store it accordingly. To reduce a Fraction: use a function that reduces a fraction to its proper format. Add four arithmetic operators to perform calculations. |