Course Solutions Uncategorized (Solved) : Find Error Chapter 5 6e Starting Java Gladdis Find Errors Following Code 1 Code Contains E Q31440847 . . . .

(Solved) : Find Error Chapter 5 6e Starting Java Gladdis Find Errors Following Code 1 Code Contains E Q31440847 . . . .

 

Find Error Chapter 5 6E of Starting Out With Java byGladdis

Find the errors in the following code.

1. // This code contains ERRORS!

// It adds two numbers entered by the user.

int num1, num2;

String input;

char again;

Scanner keyboard = new Scanner(System.in);

while (again == ‘y’ || again == ‘Y’)

System.out.print(“Enter a number: “); num1 =keyboard.nextInt();

System.out.print(“Enter another number: “; num2 =keyboard.nextInt();

System.out.println(“Their sum is “+ (num1 + num2));

System.out.println(“Do you want to do this again? “);

keyboard.nextLine(); // Consume remaining newline

input = keyboard.nextLine();
again = input.charAt(0);

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post