Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
example of a logic bug using pseudocode
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Daniel Pitts, post: 3594343"] [snip] The count would go on forever, Sounds about right. Actually, I think you've missed this one. Think about "special" cases. what happens when Temperature = 25, 30, and 35 One thing, you don't need to define what a bug is every time you point one out. For your first example, try something like "This is a bug because someone expected the loop to end, but it never does". The other thing that is necessary for it to be a logic bug, is that it doesn't do what the logician wanted. It might be perfectly reasonable to have an infinite loop, or to only close the window when Temperature == 30. While the expressed intention seems to indicate a missed assumption on the programmers part (using x<30 || x>30 instead of x==30), it is a valid expression and valid logic. A better example might be "intent: close window when the temperature is outside of the range (30 to 50)" and your code is "if temperature < 30 and temperature > 50 then closeWindow" Hope this helps, Good luck in your coursework. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
example of a logic bug using pseudocode
Top