Thread: C++ Problem! Help!

  1. #1
    Registered User
    Join Date
    Nov 2001

    Unhappy C++ Problem! Help!

    i need help writing this program. i have no clue how.

    A mixed number is composed of three integers, with the first integer representing a whole number, the second integer representing the numerator of the fractional part, and the third integer representing the denomination of the fractional part. For example: 1 2/3 or -6 7/8. Two mixed numbers are capable of being added, subtracted, multiplied, and divided according to basic arithmetic rules. They can also be compared to determine which one is smaller.

    Create a MixedNumber class. You should provide constructors to make objects out of triples of int values; this is a three int parameter constructor. You should also provide constructors to make objects out of single int values, since every int is also a complete mixed number, as in 2 = 2 0/1 or 17 = 17 0/1.

    Provide non-member functions add, sub, mul, and div that have two mixed number reference arguments and return a mixed number value. Provide a function Iess that returns a bool value that has two mixed number reference parameters. These functions should do the operation suggested by the name. Provide function neg that takes a single reference mixed number parameter and returns the negative of the mixed number argument. Provide function void copy that has two reference mixed number parameters. The first is a reference parameter called to, and the second is a reference parameter that is called from. This function copies one mixed number to another.

    Let any sign be carried by the whole number, keep the numerator and the denominator positive.

    Design and implement a menu driven program that will test all the features of your MixedNumber class, especially the ability to do mixed number arithmetic..

  2. #2
    What have you done so far? What specific portion do you need help with?
    "There's always another way"
    -lightatdawn (

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM