Identifying and Correcting Errors (Unit 1.4)
- Identifying and Correcting Errors Video #1 Notes
- Identifying and Correcting Errors Video #2 Notes
- Identifying and Correcting Errors Video #3 Notes
- MCQ Grade:
Identifying and Correcting Errors Video #1 Notes
- Programmers run into errors many times and it is a part of the programming process
- Logic Error: when the programmer makes a mistake in the algorithm that causes an unexpected result
- Syntax Error: a typo in the code that doesn’t let the program to run or compile
- Run-Time Error: the program fails while running, it can run but cannot finish the processes, also called a bug
- Overflow Error: when the result is too large for the range
- Takeaway: How to identify an error and understand the 4 main errors
Identifying and Correcting Errors Video #2 Notes
- How to correct a syntax error: use the IDEs’ suggestion and guidance of where the error is happening
- How to correct logic errors:
- use Test Cases and try out different inputs
- Hand Tracing: writing out the values of variables within the loop as it iterates to determine if the result is correct
- Add Extra Outputs: help to find and fix the error
- Some IDEs show visualizations and debuggers to help correct errors
- Takeaway: How to correct errors and ways to correct and find errors
Identifying and Correcting Errors Video #3 Notes
- Programmers start thinking of and does testing from start to finish
- Testing to make sure the requirements are met
- Minimum number example: C wouldn’t work because the minimum number would be rewritten every single round
- Temperature example: B because the sign should have been less than or equal to
- The testing is used to revise, refine, and improve the program
- Testing is used to find and fix problems in the program
- Takeaway: Identify inputs and intended outputs by testing the program
MCQ Grade:
Question 3 Corrections: the Number 7 results in the correct answer. But number 8 results in check minus instead of check.