Question: What is the function of the following code? Scanner scan = new Scanner ( System . in ) ; System.out.print ( Enter an integer:
What is the function of the following code?
Scanner scan new ScannerSystemin;
System.out.printEnter an integer: ;
number scan.nextInt;
while number
Systemout.printThat number was not correct.";
Systemout.printEnter another integer: ;
number scan.nextInt;
a
Makes sure the input is negative
b
Makes sure the input is positive
c
Makes sure the users inputs a number
d
Makes sure the user inputs a number without error
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
