Archibald Haddock (123456789) COMP-202B, Section 0 (Winter 2009) Instructor: Cuthbert Calculus Assignment 1, Question 4 1. Line: 3 Error: Class name Kumbers does not match the file name Numbers.java Type: Syntactic Fix: Change class name from Kumbers to Numbers New line: public class Numbers 2. Line: 8 Error: The semicolon (;) right after difference makes product; an invalid variable declaration Type: Syntactic Fix: Replace the semicolon right after difference with a comma (,) New line: int sum, difference, product; 3. Line: 16 Error: There should be a semicolon to mark the end of the statement Type: Syntactic Fix: Add a semicolon at the end of the line New line: secondNumber = input.nextInt(); 4. Line: 20 Error: The purpose of the line is to compute the difference of the two numbers, but their sum is computed instead Type: Semantic Fix: Replace the plus sign (+) by a minus sign (-) New line: difference = firstNumber - secondNumber; 5. Line: 22 Error: The division of two values of type int results in a value of type int, so the decimal part is lost Type: Semantic Fix: Cast one of the two operands to float by writing (float) in front of it, thus forcing floating point division New line: division = (float)firstNumber / secondNumber; 6. Line: 26 Error: The String literal "The difference is: " and the value of variable difference are not properly combined Type: Syntactic Fix: Add a plus sign between "The difference is: " and difference New line: System.out.println("The difference is: " + difference);