Question: Write a C program to show a menu to the user to select the function to evaluate. The menu will look like: Please select an

Write a C program to show a menu to the user to select the function to evaluate.

The menu will look like:

Please select an option:

a) Evaluate exponential function

b) Evaluate sin function

c) Exit

The only options valid are from a to c. Any other option should display a message warning the user, and asking to try again. The program will finish only when option c is chosen. If a or b is chosen, the program will ask the user to enter a value for x, and number of terms (t); after the values are entered, the program will call a function to evaluate the corresponding series, and display the result of comparing the value obtained using the series to the value using the corresponding function (exp or sin) in math.h, and the percent error(difference between your calculation and the value from the math.h function), immediately after (press any key to continue), the program will display the menu again.

 Write a C program to show a menu to the user

the program should display a table like:

x t result math.h %error

0.5 4 1.6484 1.6487 0.0195

The exp and sin of x, can be obtained using power series: 83 x2 x3 x4 exp(x) = ex=,n= 1 + x + + n=0 (-1)"x2n+1 sin(x) = 2 (2n + 1)! = x-31 + 5! + Vexp-Vmathh100 Vmath.h

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!