Question: The P5Fractions.txt is shown here! Easy-reading please!! Task: Add pairs of fractions and simplify the resulting sums. The program should be able to manage signed
The P5Fractions.txt is shown here!
Easy-reading please!! Task: Add pairs of fractions and simplify the resulting sums. The program should be able to manage signed numbers, like or unlike denominators, and input values of zero in either a numerator or a denominator. A zero denominator should be handled by printing an appropriate error message in the output file and not cause the program to end. The final sums should be reduced to lowest terms, and improper fractions should be converted to mixed numbers. Use the Euclidean algorithm to find the GCF to simplify fractions. Organize the program with appropriate functions. The program will be submitted in C++, with pseudocode. Input: For each pair of fractions, accept input values for numerator 1, denominator 1, numerator 2, and denominator 2-The input data file is: P5Fractions.txt. All the input values are integers. Here are the fractions that will be added: -25 41 17 10 -15 Output: Print an appropriate header in the output file, and then print each pair of addend fractions and their sum in the file. Note that negative signs should not be displayed in a denominator. If a mixed number is negative, print only one minus sign (i.e., print-1 1/4 rather than-1-1/4). If the final result is an integer, no fraction portion should be displayed. If the final result is only a fraction with no whole number part, do not print a whole number of Sample output 3/81/613/ 13/24 11/3-45/9 -5/6= -10/11= -18/11 8/9 + -9/11 +
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
