Question: C++ Rational Number Calculator using Value-Returning and Void Functions. I need to create a rational number calculator where the functions are defined in a header
C++ Rational Number Calculator using Value-Returning and Void Functions. I need to create a rational number calculator where the functions are defined in a header file. Any help would be appreciated. Thank you.








A rational number is a number that can be expressed as a fraction of the form a/b, where a is the numerator and b is the denominator and both are integers Arithmetic operations on two rational numbers a/b and c/d are defined as follows: Addition : a + c =I (a * d) + (c * b) b d (b * d) subtraction : a c -I(a d-,b) - (b * d) Write an interactive program that presents the following menu to the user Rational numbers calculator (A) ddition (S)ubtraction (Q)uit Enter your option: The menu must be displayed by a void function named showMenu ). This function just shows the title and the options, the decision whether to cal1 add, subtract , or quit must be done in main) The Addition and Subtraction options must be implemented by a couple of void functions named add ) and subtract ) respectively. These functions must clear the screen and show a title specifying the operation to be performed. Next, they have to show a couple of input prompts asking for the rational numbers and, after getting and processing them, they have to display the result A rational number is a number that can be expressed as a fraction of the form a/b, where a is the numerator and b is the denominator and both are integers Arithmetic operations on two rational numbers a/b and c/d are defined as follows: Addition : a + c =I (a * d) + (c * b) b d (b * d) subtraction : a c -I(a d-,b) - (b * d) Write an interactive program that presents the following menu to the user Rational numbers calculator (A) ddition (S)ubtraction (Q)uit Enter your option: The menu must be displayed by a void function named showMenu ). This function just shows the title and the options, the decision whether to cal1 add, subtract , or quit must be done in main) The Addition and Subtraction options must be implemented by a couple of void functions named add ) and subtract ) respectively. These functions must clear the screen and show a title specifying the operation to be performed. Next, they have to show a couple of input prompts asking for the rational numbers and, after getting and processing them, they have to display the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
