Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

Look at this link then locate three errors and suggest a corrected piece of code:http://imageshack.us/photo/my-images/401/codep.jpg/

OpenStudy (anonymous):

I don't see anything wrong with this pseudocode. Maybe You didn't tell us all available information?

OpenStudy (anonymous):

There is you just need to understand this code

OpenStudy (anonymous):

I see three logic errors but no syntax errors.

OpenStudy (anonymous):

I think what lenquist means is that the code will actually run, and not crash. Since you didnt tell us what the purpose of the code is, we cant know for sure if there is a logic error that would result in it not performing that purpose. Having said that, it looks highly likely that "if x>h then x=h" should be something else, perhaps "if x>h then h=x"? As I said, without knowing what the code is trying to achieve I cant say for sure, but as it stands, changing h to equal x has no purpose at all since x is not used for anything. Also, "until c<20" is perfectly functional code but I would guess that it should be "until c>20" or "until c=20" instead, since otherwise the loop is guaranteed to exit after just one iteration, rendering the loop itself pointless. I'm not sure what the third logic error is, though. If you could tell me what the code's supposed to actually do maybe I could see it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!