Join IDNLearn.com and start getting the answers you've been searching for. Join our community to access reliable and comprehensive responses to your questions from experienced professionals.
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 (+, - *, or /) and input the numerator and denominator of each fraction. Furthermore, your program must run until the user quits and must consist of at least the following functions:menu: This function informs the user about the program's purpose, explains how to enter data, how to quit and allows the user to select the operation.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.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.multiplyFractions: This function takes as input four integers representing the numerators and denominators of two fractions, multiplies the fractions, and returns the numerator and denominator of the result.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.Here are some sample outputs of the program3 / 4 +2 / 5 = 23 / 202 / 3 * 3 / 5 = 2 / 5The answer needs to be in the lowest terms. Your program when executed must: i. display a menu to the user that instructs them how to run input data and how to terminate the program. ii. run until the user quits. iii. correctly add,subtract, multiply and divide fractions and return the resulting fraction in its lowest terms.
Sagot :
Your participation is crucial to us. Keep sharing your knowledge and experiences. Let's create a learning environment that is both enjoyable and beneficial. IDNLearn.com is your go-to source for accurate answers. Thanks for stopping by, and come back for more helpful information.