I need help with this very bad. The professor wont get back to me and I am lost. All the other student aren't able to help me either. I have some code done but i have this as well to see the assignment. http://imgur.com/N011kop . Anthing can help. Thank you
Include a mutator function with 2 integer arguments. It is to be used to set the (unsigned) numerator and the (unsigned) denominator, and determine the overal sign.
Either input can be negative or positive. And you have to take the absolute value of one for the numerator, the absolute value of the other for the denominator. Finally, you have to determine the sign and set it to + or -.
Can you do those steps?
First of all the sign. How do you determine the sign during division? If one is negatve, the result is negative, otherwise it's positive.
Then you have to work out how to set the absoulute value of a number. What does multiplying by -1 do to a number?
You have all the pieces, now you just need to code it.
Ok. You have more than enough information to do those two pieces. Let's see what you can do.