Question: Write a C + + * * ( Fraction calculator ) * * | Write a program that lets the user perform arithmetic operations on

Write a C++
**(Fraction calculator)**| Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, in which a and b are integers and b !=0. Your program must be menu driven, allowing the user to select the operation (+,,*, or /) and input the numerator and denominator of each fraction. Furthermore, your program must consist of at least the following functions:
Function menu: This function informs the user about the programs purpose, explains how to enter data, and allows the user to select the operation.
Function addFractions: This function takes as input four integers representing the numerators and denominators of two fractions, adds the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.)
Function subtractFractions: This function takes as input four integers representing the numerators and denominators of two fractions, subtracts the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.)
Function multiplyFractions: This function takes as input four integers representing the numerators and denominators of two fractions, multiplies the fractions, and returns the numerators and denominators of the result. (Notice that this function has a total of six parameters.)
Function divideFractions: This function takes as input four integers representing the numerators and denominators of two fractions, divides the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.) Some sample outputs are:
**3/4+2/5=23/20**
2/3*3/5=6/15
Your answer need not be in the lowest terms.
Task #01: Program Outputs Correctly and contains required functions
Test Feedback:
Status: PASSED!
Check: 1
Test: Check for function `menu`
Reason: void menu +` was found in the program.None
Timestamp: 2024-09-2518:18:09.869586
Status: PASSED!
Check: 2
Test: Check for function `addFractions`
Reason: void addFractions(+` was found in the program.None
Timestamp: 2024-09-2518:18:09.869966
Status: PASSED!
Check: 3
Test: Check for function `subtractFractions`
Reason: void subtractFractions(+` was found in the program.None
Timestamp: 2024-09-2518:18:09.870373
Status: PASSED!
Check: 4
Test: Check for function `multiplyFractions`
Reason: void.multiplyFractions\(+` was found in the program.None
Timestamp: 2024-09-2518:18:09.870705
Status: PASSED!
Check: 5
Test: Check for function `divideFractions`
Reason: void divideFractions +` was found in the program.None
Timestamp: 2024-09-2518:18:09.870995
Status: FAILED!
Check: 6
Test: Successful Output
Reason: Unable to find '['61/72','17/40','10/32','40/45']' in the program's output.
Welcome to the Fraction Calculator!
This program allows you to perform operations on fractions (+,-,*,/).
Enter fractions as two integers separated by a space (numerator denominator).
The result will not be simplified.
Enter your choice of operation (+,-,*,/): Enter numerator and denominator of the first fraction (e.g.,34 for 3/4): Enter numerator and denominator of the second fraction (e.g.,25 for 2/5): Invalid operation.
.
Error : AssertionError - Unable to find 61/72 in the program's output.
Timestamp: 2024-09-2518:18:09.875692

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 Programming Questions!