Thread: need help in this programme.............

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    Post need help in this programme.............

    Develop a class named Fraction. This class handles fraction’s numerator and denumerator.It should include three constructors -- one with no parameters and which creates the fraction 0/1, one with one parameter numer and which creates the fraction numer/1, and one with two parameters and which creates the fraction numer/denom, but which assures that the fraction will be in normalized form (that is, positive denominator and with the greatest common divisor removed from the numerator and denominator).
    Make sure that the store method also stores fractions in normalized form. The class should also have copy constructor. Add three public methods (functions) to the class, called getNumerator, getDenominator, and display that return the values of the numerator, denominator of the fraction and display fraction.
    The class fraction should be able to overload operators which includes, +,-,*,/,+=,-=,*=,/=,<<,>>,==,!=,<,>,>=,<=,[],++,--,(),&&,||,&,->, ->*
    The header file and implementation files should be separate files.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What have you done so far and what problems are you facing?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Apr 2012
    Posts
    2
    i have overloaded different operaters but i dont know how to overload all these operater in one class.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. about this programme
    By kasun007 in forum C Programming
    Replies: 1
    Last Post: 03-07-2011, 08:52 PM
  2. programme
    By muraja in forum C++ Programming
    Replies: 1
    Last Post: 04-14-2010, 12:44 PM
  3. help me with ma c programme..
    By eddie19 in forum C Programming
    Replies: 19
    Last Post: 08-12-2009, 07:53 AM
  4. Need help with this programme
    By korede in forum C++ Programming
    Replies: 2
    Last Post: 05-24-2007, 12:14 PM
  5. please fix this programme
    By carsonng2000 in forum C++ Programming
    Replies: 10
    Last Post: 05-17-2005, 11:16 AM