R
rayleon
Dear Sirs or Madam:
I'm almost done with my CIS 150 - Programming Fundamentals class. I have a
question that I believe I have two answers for and would like to double
check with the group for correctness.
9. Present an example of a logic bug using pseudocode and explain your
answer. (10 points)
My two pseudocode snippets would be:
1. Set counter to 10
WHILE counter>=5 DO
increase counter by 10
This is a logic bug because the above will produce unintended or undesired
output or other behavior, but not fail. The count would go on forever,
although it may not immediately be recognized.
--------------------------------------------------------------------------------------------------------------------------------------------------
2. if (Temperature > 30) || (Temperature < 30 ){
closeWindows;
}
This is a logic bug because the above will produce unintended or undesired
output or other behavior, but not fail. The windows would never get closed,
although it may not immediately be recognized.
If I am in error on my assumptions any advice is greatly appreciated. Also
if anyone has a better example please feel free to advise me also. You've
all been great and I hope I can help someone one day here also.
Thank You,
Ray
I'm almost done with my CIS 150 - Programming Fundamentals class. I have a
question that I believe I have two answers for and would like to double
check with the group for correctness.
9. Present an example of a logic bug using pseudocode and explain your
answer. (10 points)
My two pseudocode snippets would be:
1. Set counter to 10
WHILE counter>=5 DO
increase counter by 10
This is a logic bug because the above will produce unintended or undesired
output or other behavior, but not fail. The count would go on forever,
although it may not immediately be recognized.
--------------------------------------------------------------------------------------------------------------------------------------------------
2. if (Temperature > 30) || (Temperature < 30 ){
closeWindows;
}
This is a logic bug because the above will produce unintended or undesired
output or other behavior, but not fail. The windows would never get closed,
although it may not immediately be recognized.
If I am in error on my assumptions any advice is greatly appreciated. Also
if anyone has a better example please feel free to advise me also. You've
all been great and I hope I can help someone one day here also.
Thank You,
Ray