Question: Within the corresponding switch selection, your program 1) prints your name > Please enter a Fahrenheit degree number: if you entered F or f; prints
Within the corresponding switch selection, your program
1) prints "your name > Please enter a Fahrenheit degree number:" if you entered F or f; prints "your name > Please enter a Celsius degree number:" if you entered C or c.
2) reads the input number, which should be a "double" and should be passed as a parameter into the following corresponding function.
3) in case of F or f, call a function "double fc_converter(double);" with the input value; in case of C or c, call a function "double cf_converter(double);" otherwise, you inform the user "The input is unknown!" in the default selection.
4. In "double fc_converter(double);" you should use "if" to do the following.
1) if you enter a number in the range of -200 to +200, for example, "32", it will calculate according to the equation: C = FCR*(F - 32.00), where FCR is a pre-defined constant 0.556. Your variable should be in "double". After that, it will print the following before returning the Celsius degree:
32.00 F ==> 0.00 C
2) otherwise, it will print "Invalid Celsius temperature." and return a value according to the equation: C = sqrt(F).
5. Similarly, in "double cf_converter(double);" you should use "if" to do the following.
1) if you enter a number in the range of -200 to + 200, for example, "0", it will calculate according to the equation: F = CFR*C + 32.00, where CFR is a defined constant 1.8. After that, it will print the following before returning the Fahrenheit degree:
0.00 C ==> 32.00 F
2) otherwise, it will print "Invalid Fahrenheit temperature." and return a value according to the equation F = pow(C, 3).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
