Read section 4.1.3 on page 145 first, then complete R4.12 on page 164. Please feel free to copy and paste the code below to Codiva and try.
correct code:
import java.util.Scanner;
public class HasError
{
public static void main(String[] args)
{
int x = 0;
int y = 0;
Scanner in = new Scanner(System.in);
System.out.print("Please enter an integer:");
x = in.nextInt();
System.out.print("Please enter another integer: ");
y = in.nextInt();
System.out.print("The sum is ");
System.out.print(x + y);
}
}