Question: Consider the following script file. Fill in the lines of the following table with the values that would be displayed immediately after the while statement

Consider the following script file. Fill in the lines of the following table with the values that would be displayed immediately after the while statement if you ran the script file. Write in the values the variables have each time the while statement is executed. You might need more or fewer lines in the table. Then type in the file, and run it to check your answers.
k = 1;b = -2;x = -1;y = -2;
while k <= 3
k, b, x, y
y = x^2 - 3;

if y < b
b = y;
end
x = x + 1;
k = k + 1;
end

Pass k b y First Second Third Fourth Fifth

Pass k b y First Second Third Fourth Fifth

Step by Step Solution

3.43 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Table ... View full answer

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 Introduction Mechanical Engineering Questions!