subject

Copy the following code into a new Java file in Eclipse.

import java. util. Scanner;

public class EclipseVsZyBooks {

public static void main(String[] args) {

System. out. println("Enter an integer: ");

int a = readInt();

System. out. println("Enter a second integer: ");

int b = readInt();

if(a == b)

System. out. println(a + " equals " + b);

else if (a < b)

System. out. println(a + " is less than " + b);

else

System. out. println(a + " is more than " + b);

}

public static int readInt() {

Scanner sc = new Scanner(System. in);

return sc. nextInt();

}

}

(2) Run the code in Eclipse.

(3) Try running the code in 1.14 zyBooks built-in programming window, using the same input that you did in (2). You can use this environment to test your code before submitting it to zyBooks.

(4) Try submitting the code. You should see that the 3 tests produce the same error you saw in (3).

(5) The code should run fine in (2), but give you errors in (3) and (4). Refactor the code so that it works in zyBooks just as it does in Eclipse.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, Lacey9319
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
image
Computers and Technology, 22.06.2019 17:30, babyface1686
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, juuuuuu42
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
image
Computers and Technology, 24.06.2019 13:30, lorelaistudent
Does anybody know how to hack into a google account? i had important information on it and it is gone now and i need getting it back.
Answers: 1
You know the right answer?
Copy the following code into a new Java file in Eclipse.

import java. util. Scanner;

Questions in other subjects:

Konu
Biology, 16.10.2019 11:00
Konu
Biology, 16.10.2019 11:00