Overloading operators

Hello Everyone,
I am very new in programming and have a problem that I have no idea as to how to solve. I was recommended to register on this site and told that I would certainly get the help I need. Can anyone please show me what to do with this problem? I am totally lost.

I have been instructed to take a Fraction Class and overload the following operators: <<, >>, +, -, *, /, != and ==, and create a program that allows the user to choose the arithmetic operation that they want to perform. And after selecting an operation the user should be presented with an arithmetic problem for where they should enter the correct answer. The answer doesn't have to be in reduced form, but the program should accept any correct answer. Example: 1/3, 3/0, and 6/18 are all correct answers. I am instructed to (take care of this in the overloaded == operator).

The << operator should display fractions as numerator/denominator unless it is and improper fraction in which case it should be displayed as a mixed fraction. Improper fractions that will evaluate to a whole number should be displayed as just the whole number with no fraction part. Example 10/2 should be displayed as 5.

The >> operator should read all fractions as numerator / denominator

The program should use 4 fraction objects: Two for the operands, one for eh calculated answer, and one for the users answer.

Thank you in advance for any help you can offer.
Last edited on
Look up information on classes first. Create a fraction class to do this stuff by overloading the operators. Go look that up too. If you have problems with any code that you have made after that, feel free to ask.
Topic archived. No new replies allowed.