Identify at least 5 errors in the following code see next pa

Identify at least 5 errors in the following code (see next page) and the fix for it (suggested time spent a 10 minutes, 1 point for each error correctly identified, 1 point for correct fix partial credits for fix it correctly identified the error for this question an error could be a syntax error or a logic error (code compiles, but does the wrong thing) public class errors Question {public static void main (string[] args) for (int 1 - 10; 1

Solution

The first error is in a line 9, there is syntax error no close bracket in it.

The correct code will be: System.out.println(\"Take one down, give it to cats..\");

The second erros is in a line 11, which is of type error boolean can\'t be int.

A next error is in line 13 which is of syntax error. Correct code will be: if(i>5 && i<7)

A next error is in line 15 we can\'t print undeclare variable this is of not define error. Correct code will be: System.out.println(getSpecialMilk());

And in line 30 we should define function type, in this case type is string the correct code will be: public static String GetSpecialMilk(){}

There are many others error like number of \"{\" is not equal to \"}\".

 Identify at least 5 errors in the following code (see next page) and the fix for it (suggested time spent a 10 minutes, 1 point for each error correctly identi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site