Evidence of quizzes

Questions Missed

  • I missed question 3 because I thought that 6 and 7 would lead to incorrect results since 6 and 7 aren’t bigger than 7, however, when numCorrect is 7, the condition numCorrect > 7 evaluates to false, so “check” correct. 8 would be the other correct answer because when numCorrect is 8, it is >7 which is true, so “check minus” is displayed instead of “check plus”

Video Notes

  • logic error: mistake in algorithm or program that causes it to behave incorrectly or unexpectedly. most difficult to fix
  • syntax error: mistake in program where the rules of the programming language are not followed such as missing colons or parentheses, easiest to fix
  • run-time error (bug): mistake in program that occurs during execution of a program, languages define their own runtime errors
  • overflow error- occurs when computer tries to handle a number outside of the defined range of values

    How to fix:

  • hand tracing: most helpful with iterations, writing out values of the variables within the loop as it iterates to determine if outcome is correct, useful for small code segments and loops that iterate a small number of times, larger loops may need debugger program
  • adding extra output statements
  • test cases
  • visualizations, debuggers

    Testing Algorithms

  • think about lists we will use to test the algorithm
  • programmers test and test, then revise and test more, then users test, and programs refine, then the program is released