Computers and Technology
Computers and Technology, 14.03.2020 06:26, dave9811

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:50, carterjavon6929
Python write an expression that executes the loop body as long as the user enters a non-negative number. note: if the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "program end never reached." the system doesn't print the test case that caused the reported message. sample outputs with inputs: 9 5 2 -1
Answers: 3
image
Computers and Technology, 22.06.2019 06:30, Melissamv2052
Selective incapacitation is a strategy to reduce prison population
Answers: 3
image
Computers and Technology, 22.06.2019 18:30, ovoxotas
Which of the following commands is more recommended while creating a bot?
Answers: 1
image
Computers and Technology, 22.06.2019 18:40, penelopymorales24
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
Do you know the correct answer?
Copy the following code into a new Java file in Eclipse.

import java. util. Scanner;

Questions in other subjects: