Question: C++ Program Create a program that performs mathematical operations on fractions. The program should present the user with a menu with the following choices: 1.

C++ Program

Create a program that performs mathematical operations on fractions. The program should present the user with a menu with the following choices:

1. Addition

2. Subtraction

3. Multiplication

4. Division

5. Exit

Use and enumerated data type for the menu choices:

enum mathOperation {ADD, SUBTRACT, MULTIPLY, DIVIDE}

You will need a function to display the menu and get the user's choice. A loop that displays the menu and test the user's choice is the only code that belongs in main().

Each menu choice will need a function except Exit.

You will also need a function to get the 2 fractions from the user. Ask the user to enter the fractions in fraction format, numerator/denominator (ex. 1/2). You will use string functions to parse out the numerator and denominator. (You will use the substr, length, compare, and append functions)

After the math is preformed on the fractions, you will need another function to reduce the results. Then print the results to the screen in the following format:

The sum of 1/2 + 2/4 = 3/4

NO Global Variables can be used in your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!