Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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: 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 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.) c. 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.) d. 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.) e. 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.) Your answer need not be in the lowest terms. Your program must validate all users' inputs: 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: 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 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.) c. 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.) d. 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.) e. 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.) Your answer need not be in the lowest terms. Your program must validate all users' inputs:
Expert Answer:
Answer rating: 100% (QA)
Heres a C program that fulfills the requirements you provided It includes a menu function and functions for addition subtraction multiplication and di... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
Company Revenue for Fiscal Year 2014 (millions of dollars) Walmart 476,294 Exxon Mobil 407,666 Apple 170,910 General Motors 155,427 Ford Motor 146,917 General Electric 146231 Identify and explain...
-
In Rev. Rul. 81-301, which of the following is not a factor considered by the IRS in determining whether a partner receives payments in her capacity as a partner, or is instead acting as a third...
-
Halloween is the biggest candy season of them all, with 41.8 BILLION IN SALES. For Hershey's Halloween 1999 was the scariest of all time. Hershey's had planned to implement a $112 million ERP system...
-
For the following exercises, find all solutions exactly to the equations on the interval [0,2). A 20-foot tall building has a shadow that is 55 feet long. What is the angle of elevation of the sun?
-
In 2011, quarterbacks Tom Brady, Drew Brees, and Payton Manning, representing a class including current NFL players, claimed that a league-imposed lockout was a horizontal group boycott among...
-
Oki Products, Ltd., has observed the following processing costs at various levels of activity over the last 15 months: Required: 1. Prepare a scattergraph using the above data. Plot cost on the...
-
1. If the wavelength of a-line of Lyman series in hydrogen atom is , find the wavelength of -line of Paschen series. 3256 (b) 36x5 22 (c) 3522 26 (d) 32 x5 26 2. If temperature of a liquid is...
-
Spa Ariana promotes itself as an upscale spa offering a variety of treatments, including massages, facials, and manicures, performed in a luxurious setting by qualified therapists. The owners of Spa...
-
How Supernovae Are Formed? "The Life Cycles of Stars"
-
On March 1 , 1 9 9 3 , Elwood deposited $ 4 , 2 0 0 into a bank account. The account credited interest at a nominal interest rate of 4 % per year, compounded quarterly, when the balance was under $ 5...
-
A taxpayer has $5,000 in cash donations to various charitable organizations during the year. $2,000 of these are not substantiated with a contemporaneous written acknowledgement from the donee...
-
Commercial Carpets manufactures custom mats. The details on its standard run of a 1 m x 2 m mat is as follows: Quantity Unit Selling Price Unit Variable Cost Fixed Costs 3 2 0 $ 5 6 $ 3 1 $ 1 , 9 0 0...
-
In an X-ray powder camera using incident copper radiation of wavelength 1.5418 , a diffraction line is produced at 20= 45.8. determine the miller indices for the reflecting planes if a = 3.44 .
-
A taxpayer gets into rocky straits with their spouse and begins the process of filing for divorce, choosing to file separately for TY2023. The taxpayer initially begins as the sole owner of their...
-
John Dorilane IV is president and CEO of Dorilane Furniture Co. of Milltown Pa. Dorilane Furniture Co. produces a very successful patio furniture set that retails for $1,200. All the sets produced...
-
How much more interest will be earned if $5000 is invested for 6 years at 7% compounded continuously, instead of at 7% compounded quarterly?
-
List five steps to help the analyst observe the decision makers typical activities.
-
What is the difference between a logical and physical data flow diagram?
-
List the two types of team leaders.
-
Consider the following time series data. a. Construct a time series plot. What type of pattern exists in the data? b. Show the four-quarter and centered moving average values for this time series. c....
-
Refer to exercise 35. a. Deseasonalize the time series using the adjusted seasonal indexes computed in part (c) of exercise 35. b. Using Minitab or Excel, compute the linear trend regression equation...
-
The following table reports prices and usage quantities for two items in 2009 and 2011. a. Compute price relatives for each item in 2011 using 2009 as the base period. b. Compute an unweighted...
Study smarter with the SolutionInn App