0

Rational fractions are of the form a/b, where a and b are integers and b≠0. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules:
a/b + c/d = (ad + bc) / bd
a/b – c/d = (ad – bc) / bd
a/b x c/d = (ac)/(bd)
(a/b) / (c/d) = ad/bc, where c/d ≠0
Fractions are compared as follows:
a/b op c/d if ad op bc, where op is any of the relational operators. For example, a/b < c/d if ad < bc.
Design a class, FractionType, that performs the arithmetic and relational operations on fractions. Overload the arithmetic and relational operators so that the appropriate symbols can be used to perform the operation. Also, overload the stream insertion operator and stream extraction operator for easy input and output.
Write a C++ program that uses the FractionType class to perform operations on fractions. Note that your answers do not need to be in lowest terms.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by WaltP
1

The usual rule around here is that you pay us 100 dollars per an hour.
It usually takes us 1-2 hour per homework. So what do you think?

Votes + Comments
That's too conservative of an estimate. First we've got to find yet another forum to repost his question on, wait for that answer, come back, answer the OP's question. That could take a day or two... :)
0

Or you could try reading the Member Rules, or the pertinent sticky posts at the top of the forum, like the post Read This Before Posting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.