When debugging a program, whether it be your own or someone elseβs, itβs best to understand what the program is trying to do first. Read through the code and comments before editing the program. Also, when errors occur, it helps to start from the line number of the error and work your way backwards.
The program below contains multiple errors. Your objective is to debug the program, and match the expected output (see below the code). You can run the code to see error messages.