Purchase Solution

C++ Prog. for performing arithmetic operations on fractions.

Not what you're looking for?

Ask Custom Question

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0. Your program must be menu driven, allowing the user to select the operation (+, -, *, /) and input the numerator and denominator of each fraction. Your program must consist of at least the following functions:

a. Function menu: This function informs the user about the program's purpose, explains how to enter data, and allows the user to select the operation.

b. Function addFractions: This function adds two fractions together (or you can overload the +operator()).

c. Function subtractFractions: This function subtracts one fraction from another (or you can overload the -operator()).

d. Function multiplyFractions: This function multiplies two fractions together (or you can overload the *operator()).

e. Function divideFractions: This function divides one fraction into another (or you can overload the /operator()).

Some sample outputs are:
3 / 4 + 2 / 5 = 23 / 20
2 / 3 * 3 / 5 = 6 / 15

Your answers need not be in the lowest terms.

Purchase this Solution

Solution Summary

The programs are properly commented to make it easier for you to understand!

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C++ Operators

This quiz tests a student's knowledge about C++ operators.