Answer
Step 1: Start
Step 2: Input value to be evaluated x and maximum order n Step 3: Set order (i) equal to one
Step 4: Set accumulator for approximation (approx) to zero Step 5: Set accumulator for factorial product (fact) equal to one Step 6: Calculate true value of sin(x)
Step 7: If order is greater than n then proceed to step 13
Otherwise, proceed to next step
Step 8: Calculate the approximation with the formula
approx = approx + (−1)i-1 x2i-1 factor
Step 9: Determine the error
%error= true−approx100% true
Step 10: Increment the order by one
Step 11: Determine the factorial for the next iteration
factor = factor • (2 • i − 2) • (2 • i − 1)
Step 12: Return to step 7 Step 13: End
Work Step by Step
Step 1: Start
Step 2: Input value to be evaluated x and maximum order n Step 3: Set order (i) equal to one
Step 4: Set accumulator for approximation (approx) to zero Step 5: Set accumulator for factorial product (fact) equal to one Step 6: Calculate true value of sin(x)
Step 7: If order is greater than n then proceed to step 13
Otherwise, proceed to next step
Step 8: Calculate the approximation with the formula
approx = approx + (−1)i-1 x2i-1 factor
Step 9: Determine the error
%error= true−approx100% true
Step 10: Increment the order by one
Step 11: Determine the factorial for the next iteration
factor = factor • (2 • i − 2) • (2 • i − 1)
Step 12: Return to step 7 Step 13: End