English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Consider the following loop with the indicated assertions. What is the value or range of values for X at points A and B in the program? Assume that the initial value of X is less than or equal to 86 so that we enter the loop.

while (X<=86)

{X<=86}
X=X+7

{A:________________________}
{B:_________________________}

2006-12-05 10:48:53 · 4 answers · asked by anueurysm 2 in Computers & Internet Programming & Design

this is an example problem. i need to know how it works because i have a smiliar problem. getting the answer is useless without an explanation.

2006-12-05 10:55:07 · update #1

4 answers

Well, X can leave the loop equaling as much as 86 = 86+7, so X can leave the loop equaling as much as 93.

Assuming X must be greater than or equal to zero, the lowest X could be is 0 = 0 + 7, so 7.

2006-12-05 10:52:20 · answer #1 · answered by AlaskaGirl 4 · 0 0

The codes doesn't makes sense but here's a try.

Assuming X <= 86 when you enter the loop.
You could execute 0 times-- e.g. X=86 when you hit the while loop
If it is < 86, it will execute until X is 86 or when it is 86+7 or 93.

It would make more sense if it looked like this....

x = some value

while( x<=86)
x=x+7

2006-12-05 19:01:59 · answer #2 · answered by dapixelator 6 · 0 0

wow I wish I had stuff like this when I was going to school.. do your own homework it will help you in the long run

2006-12-05 19:05:16 · answer #3 · answered by Anonymous · 0 0

Are you trying to get "US" to do your homework??

2006-12-05 18:51:43 · answer #4 · answered by Anonymous · 2 1

fedest.com, questions and answers