Rational fractions are of the form a / b, where a and b are integers and b not equal to 0. By "fractions" I mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules:
    Rational fractions are of the form a / b, where a and b are integers and b not equal to 0. By "fractions" I mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules:

Rational fractions are of the form a / b, where a and b are integers and b not equal to 0. By "fractions" I mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules:

$15.00

Rational fractions are of the form a / b, where a and b are integers and b not equal to 0. By "fractions" I mean rational fractions. 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 * c/d = ac / bd
(a/b) / (c/d) = ad / bc , in which c/d does not equal 0.
Fractions are compared as follows: a/b op c/d if ad op bc, in which op is any of the relational operations. For example, a/b < c/d if ad < bc.
Design a class, say fractionType, that performs the arithmetic and relational operations on fractions. Overload the arithmetic and relational operators so that the appropriate symbols can be use to perform the operation. Also, overload the stream insertion and stream extraction operators for easy input and output.
Write a C++ program that, using the class fractionType, performs operations on fractions.
Among other things, test the following; Suppose x, y, and z are objects of type fractionType. If the input is 2/3 ,the statement:
cout<< x+y<< endl;
Should output the value of x + y in fraction form.

The statement:

z=x+y;

Should store the sum of x and y in z in fraction form. The answer should store the sum of x and y in z in fraction form. The answer does not need to be in lowest terms.

A++ solution for this question

Solution contain C++ program and ScreenShot.

Using DevC++ IDE to run program.

If you want run on Visual studio, you can edit some lines in source code (i can help you do it).

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



Tags: C++
PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B