Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What dose each of these programs do? How many lines of output dose each programs

ID: 440675 • Letter: W

Question

What dose each of these programs do? How many lines of output dose each programs produce? What are the last two values of x printed? X = 1; while 1+x > 1, x = x/2, pause ( .02) , end x = 1; while x+x > x, x = 2*x, pause ( . 02) , end x = 1; while x+x > x, x = x/2, pause ( . 02) , end The power series for sin x is This MATLAB function uses the series to compute sin x. function s = =powersin(x) POWERSIN. Power series eor sin(x) . POWERSIN(x) tries to compute sin(x) from a power series s = 0; t = x; n = 1; while s + t = s; end What causes the while loop terminate? Answer the following questions fro x = pi/2, 11pi/2, and 31pi/2; How accurate is the computed result? How many terms are required? What is the largest term in the series? What do conclude about the use of floating-point arithmetic and power series to evaluate functions?

Explanation / Answer

x=1;while 1+x>1, x=x/2, pause(.2),end % prints out x=.5x until 1+x>1, there is a slight pause between each print out. x = 2.2204e-016 x = 1.1102e-016 lines = 53 x=1;while x+x>x, x=2*x, pause(.2),end %prints out 2x in a infinte loop until it runs out of precision bit x = 8.9885e+307 x = Inf lines = 1024 x=1;while x+x>x, x=x/2,pause(.2),end %print out x/2 until 2x!>x x = 4.9407e-324 x = 0 lines = 1075

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote