Question: INPUT: The program will ask the user to enter a) (5 points) The function's order f_order. If the order is greater than 5 or smaller

 INPUT: The program will ask the user to enter a) (5points) The function's order f_order. If the order is greater than 5or smaller than 1, an error message should be displayed and theprogram ends, Otherwise, the program will ask for the respective coefficients. b)

INPUT: The program will ask the user to enter a) (5 points) The function's order f_order. If the order is greater than 5 or smaller than 1, an error message should be displayed and the program ends, Otherwise, the program will ask for the respective coefficients. b) (5 points) The values for xmin and xmax If the value for xmax is smaller or equal to xmin, an error messages should be displayed, and the program will end. c) (5 points) The angle a The values for a are from 0 to 360. Any value smaller than 0, or greater than 360 will be converted to its equivalent between 0-360. For example, is the value entered is -30, it will be converted to 330, or if the value entered is 400 then it will be converted to 40. Assume that f(x) is defined as: f(x) = ax**sin(a)+ bx**cos(a)+ cx**sin(a)+ dr**cos(a)+ er*sin(a) +f. (5 points) If the f_order is: 5, then the program will ask for coefficients a, b, c, d, e and f; 4, then the program will ask for coefficients b, c, d, e and f; 3, then the program will ask for coefficients c, d, e and f; 2, then the program will ask for coefficients d, e and f; 1, then the program will ask for coefficients e and f, OUTPUT: The output is formatted as a table. The first column will display the values of x, and the second column the values of f(x). The first row should always have the value xmin for x, and f(xmin) for f(x). Last row should always have the value xmax for x, and f(xmax) for f(x). The table will look like: x f(x) xmin xmin +dx xmin +2dx xmin +3dx | xmin +4dx | f(xmin) f(xmin+dx) f(xmin+2dx) f(xmin+3dx) f(xmin+4dx) xmax f(xmax) Where xmin is the value entered by the user, and f(xmin) is the result of evaluating the function when x=xmin dx is the increment size, and is defined by dx = (xmax xmin)/10 Use 2 decimals for f(x) values and 3 decimals for x values. Table formatting: 10 points Function evaluation: 25 points Include a report in a Word file that shows a) List all the variables, constants (literals, symbolic and named) in your program 2). (5 points) You are allowed to use the function float pow (float, int), found in , to calculate the powers of x, and the sin and cos functions. Topics covered: Basic C, Expression evaluation, operators, flow control statements (loops, switch-case, if-else, etc.), functions Enter f_order: -2 Your values of f_order should be between 1 to 5! Enter f order: 8 Your values off_order should be between 1 to 5! Enter f order: 4 Enter xmin and xmax values: 9.3 2.4 xmax has to be greater than xmin! Enter xmin and xmax values: 2.4 9.3 Enter angle: -30 The value of angle is 330.000000 Enter the values of coefficients a, b, c, d, e, f 1.3 5.2 3.4 5.6 8.1 7.2 1 f(x) 2.400 3.090 3.780 4.470 5.160 5.850 6.540 7.230 7.920 8.610 9.300 -65.36 -164.15 -343.11 -638.47 -1093.52 -1758.52 -2690.75 -3954.52 -5621.11 -7768.85 -10483.07 Enter f order: 3 Enter xmin and xmax values: 2.3 7.6 Enter angle: 400 The value of angle is 40.000000 Enter the values of coefficients c, d, e, f 1.2 3.4 5.6 7.8 X 1 f(x) 2.300 2.830 3.360 3.8901 4.420 4.950 5.480 6.010 6.540 7.070 40.63 58.73 82.71 113.47 151.93 199.00 255.59 322.61 400.98 491.61 INPUT: The program will ask the user to enter a) (5 points) The function's order f_order. If the order is greater than 5 or smaller than 1, an error message should be displayed and the program ends, Otherwise, the program will ask for the respective coefficients. b) (5 points) The values for xmin and xmax If the value for xmax is smaller or equal to xmin, an error messages should be displayed, and the program will end. c) (5 points) The angle a The values for a are from 0 to 360. Any value smaller than 0, or greater than 360 will be converted to its equivalent between 0-360. For example, is the value entered is -30, it will be converted to 330, or if the value entered is 400 then it will be converted to 40. Assume that f(x) is defined as: f(x) = ax**sin(a)+ bx**cos(a)+ cx**sin(a)+ dr**cos(a)+ er*sin(a) +f. (5 points) If the f_order is: 5, then the program will ask for coefficients a, b, c, d, e and f; 4, then the program will ask for coefficients b, c, d, e and f; 3, then the program will ask for coefficients c, d, e and f; 2, then the program will ask for coefficients d, e and f; 1, then the program will ask for coefficients e and f, OUTPUT: The output is formatted as a table. The first column will display the values of x, and the second column the values of f(x). The first row should always have the value xmin for x, and f(xmin) for f(x). Last row should always have the value xmax for x, and f(xmax) for f(x). The table will look like: x f(x) xmin xmin +dx xmin +2dx xmin +3dx | xmin +4dx | f(xmin) f(xmin+dx) f(xmin+2dx) f(xmin+3dx) f(xmin+4dx) xmax f(xmax) Where xmin is the value entered by the user, and f(xmin) is the result of evaluating the function when x=xmin dx is the increment size, and is defined by dx = (xmax xmin)/10 Use 2 decimals for f(x) values and 3 decimals for x values. Table formatting: 10 points Function evaluation: 25 points Include a report in a Word file that shows a) List all the variables, constants (literals, symbolic and named) in your program 2). (5 points) You are allowed to use the function float pow (float, int), found in , to calculate the powers of x, and the sin and cos functions. Topics covered: Basic C, Expression evaluation, operators, flow control statements (loops, switch-case, if-else, etc.), functions Enter f_order: -2 Your values of f_order should be between 1 to 5! Enter f order: 8 Your values off_order should be between 1 to 5! Enter f order: 4 Enter xmin and xmax values: 9.3 2.4 xmax has to be greater than xmin! Enter xmin and xmax values: 2.4 9.3 Enter angle: -30 The value of angle is 330.000000 Enter the values of coefficients a, b, c, d, e, f 1.3 5.2 3.4 5.6 8.1 7.2 1 f(x) 2.400 3.090 3.780 4.470 5.160 5.850 6.540 7.230 7.920 8.610 9.300 -65.36 -164.15 -343.11 -638.47 -1093.52 -1758.52 -2690.75 -3954.52 -5621.11 -7768.85 -10483.07 Enter f order: 3 Enter xmin and xmax values: 2.3 7.6 Enter angle: 400 The value of angle is 40.000000 Enter the values of coefficients c, d, e, f 1.2 3.4 5.6 7.8 X 1 f(x) 2.300 2.830 3.360 3.8901 4.420 4.950 5.480 6.010 6.540 7.070 40.63 58.73 82.71 113.47 151.93 199.00 255.59 322.61 400.98 491.61

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!