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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Could you find out how im still getting an 83 percent on this in edhesive a = input("enter an animal: ") s = input ("enter a sound: ") e = "e-i-e-i-o" print ("old macdonald had a farm, " + e) print ("and on his farm he had a " + a + "," + e) print ("with a " + s + "-" + s + " here and a " + s + "-" + s + " there") print ("here a " + s+ " there a " + s) print ("everywhere a " + s + "-" + s ) print ("old macdonald had a farm, " + e)
Answers: 2
question
Computers and Technology, 25.06.2019 01:30
Why is the most liked picture on instagram an eggy? owo
Answers: 1
You know the right answer?
Copy the following code into a new Java file in Eclipse.

import java. util. Scanner;
Questions
question
Mathematics, 25.03.2021 20:30
question
Mathematics, 25.03.2021 20:30
question
Mathematics, 25.03.2021 20:30
question
Mathematics, 25.03.2021 20:30
Questions on the website: 13722363