BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/index.php)
-   Object Oriented Programming (http://bzupages.com/forumdisplay.php?f=35)
-   -   how to make four fraction calculator in c++ using classes and operator overloading (http://bzupages.com/showthread.php?t=18918)

Dergk 07-10-2011 06:25 PM

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.


All times are GMT +5. The time now is 05:02 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.