1.35. What does each of these programs do? How many lines of output does each pr
ID: 440674 • Letter: 1
Question
1.35. What does each of these programs do? How many lines of output does each propram produce? What are the last two values of x printed? x 11 while 11x 1, x x/2, pause (.02) end x 1; while x+x x, x 2 x, pause (.02) end x 11 while x+x x, x x/2, pause (.02) endExplanation / Answer
1) 53 values of x are printed the last two values are 2.22 x 10^-16 1.11 x 10^-16 this program takes initial value of x=1 and does x =x/2 until for 1+x>1 condition is reached. 2)infinite values of x are printed this program takes initial value of x=1 and does x =x*2 until for x+x>x condition is reached. This condition does not converge because 2>1 is a false condition 3) infinite values of x are printed this program takes initial value of x=1 and does x =x/2 until for x+x>x condition is reached. This condition does not converge because 2>1 is a false condition
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.