







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Dr. John Cavazos Computer and Information Sciences 04/10/
๏ Common Errors ๏ Debugging Tips (pgs 72 โ 76) ๏ Symbolic Debugger (137-140)
๏ Not initializing all variables ๏ Starting array index variable at 0 ๏ Incorrect evaluation order in equation ๏ Off by one error ๏ Infinite loop
๏ Break up equation into smaller pieces ๏ Add parenthesis to make equation clear ๏ Initialize all variables!
function found = findNumber(array, value) x = 1; found = false; while (found == false) if (a(x) == value) found = true; end end What is the problem?
function found = findNumber(array, value) x = 1; found = false; while (found == false) if (a(x) == value) found = true; end x = x + 1; end Problem if value not found! Should test for this.
function found = findNumber(array, value) x = 1; found = false; while (found == false && x <= length(a)) if (a(x) == value) found = true; end x = x + 1; end
๏ Execution suspends in editor at breakpoint ๏ Can view variables in command window ๏ Can step through the code ๏ Can continue to next breakpoint 17, 2009 from 1:00 PM to 1:30 PM