Thread: some questions, need some experts ;)

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    3

    Question some questions, need some experts ;)

    Hi all


    I'm taking some courses in C++, I Finished beginner.

    So our teacher gave us some questions to think about it ( for hard word )
    and now I'm doing some researches and I need your help


    Thats the questions as it's :-
    --------------
    Write a class definition for a class named Fraction. The class contains two variables: numerator and denominator and the following functions:
    • A default constructor.
    • An overloaded constructor that sets all variables to the values specified by its arguments.
    • One get function for each variable that returns the current value.
    • One set function for each variable that sets a new value.
    • Function equal that compares two fractions and returns true if the two functions are identical; false otherwise.
    • Function Add that allows two fractions to be added and returns the result.
    • Function Subtract that allows one fraction to be subtracted from the other and returns the result.
    • Function infinite that returns true if the denominator is zero; false otherwise.
    • Function display that displays the fraction to the screen in the following format (numerator / denominator).

    Notes:
    • Any infinite fraction should be printed as "oo".
    • Embed your class in a test program.
    ---------------


    I hope you found it interesting :P

    I'm waiting for your help and thanks to all of you

    SonY

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    What is the question?

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    You're more likely to catch flies with honey than with sour. Around here that means show what you've got (ie code) and ask specific questions about specific problems. Since you've passed the beginners class I'm sure you know how to write the bare skeleton program and that you learned the computer programming hasn't eliminated the need to do a lot of the work with pen/pencil and paper.
    You're only born perfect.

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MacGyver View Post
    What is the question?
    An implicit (yet, not very subtle) "Will you do my homework for me?"

    Honestly, to the OP... this is not very interesting to anyone who's well... not taking a beginner C++ course. So, you're going to have to try a different angle if you're trying to sell us on doing your work for you. Otherwise, post some code with where you're having trouble and we'll help. I'd have to guess, though, that you haven't even made an attempt and you're just being lazy. You could probably do this with no help from us at all if you actually put an effort.
    Sent from my iPad®

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM