Types of Programming ErrorsVersión en línea Types of Programming Errors por Laura Schoenike 1 Logic Error 2 Syntax Error 3 Run Time Error 4 Overflow Error Programmer mistake in the algorithm, causing unexpected behavior (program still runs!) Ex. Assigning a value to the wrong variable Ex. Flipping a logical operator (< or >) Ex. Multiplying two numbers instead adding them Logic Error A typo that will result in the program not compiling/running Ex. Missing semicolon (;) Ex. Using square brackets instead of curly brackets Ex. Forgetting to declare a variable before using it Ex. Neglecting to put a string in quotation marks (ex. "cat") Syntax Error Program fails in the middle of running (program runs initially, but does not finish) Ex. A program failing when it tries to divide by 0 Ex. A program failing when the user enters unexpected data (ex. string instead of integer) Ex. A program failing when it references a nonexistent file Run Time Error Occurs when a program encounters a value that is too big to calculate or display Ex. a 4 bit adder adding binary numbers 0111 and 1101 Ex. Trying to fit 12 cans of soup in a box designed to fit 10 Ex. Trying to store 256 in an 8-bit binary number. Overflow Error