Description: Use the Generic Code Review list provided in the slides to review and identify 5 bugs in the file attached Take screenshots of bugs and also explain why you think each is a potential bug.
Provided Code:
Solution
Bug 1

The ‘grade’ variable is declared and initialized as an integer variable at line 64. But at line 75, a string value is assigned to this variable. This is a bug because an integer variable cannot accept the string value.
Bug 2

A semi-colon is mandatory to terminate a statement in a Java program. But at line 113, the semi-colon is missed at the end of the statement. This is another bug in the program that will cause the error.
Bug 3

A statement terminator is missing at the end of line 129. In Java, When a semi-colon is missed at the end of a statement it causes an error in the program. The statements next to this will not be executed because of this bug.
Bug 4

The maxArrayLength variable is initialized with the value 10. In line 69, there is a bug in the condition of the “for loop”. This will cause the array index out-of-bound exception because the program will try to enter the number at the 10th index that does not exist.
Bug 5

Another bug exists at line 103. In this line, there is a bug in the condition of the “for loop”. Because of this bug, the program will try to assign the 10th index value of the array to the grade variable. But the 10th index of the array does not exist.
Bug 6

Another bug is in the initialization of the “for loop”. The sumAllGrades variable is created to store the sum of all index values of the array. But the array is started from index 1 and index 0 is ignored which will not be counted in the sumAllGrades variable.
Note: For detailed code reviews, debugging assistance, and well-documented reports, contact AcademiaBees for expert support!