A+ Computer Science-Input Worksheet 1 PART 1 DIRECTIONS: Fill in each blank belo
ID: 3884001 • Letter: A
Question
A+ Computer Science-Input Worksheet 1 PART 1 DIRECTIONS: Fill in each blank below Word bank - java.util Scanner nexto I (netinto hetDouble nextLine) nextong) I nextByte() AUiScanneris the import needed to use Scanner rext lt is the Semer method used to input an ineger 2. .et DoubleC) next L) is the Scanner method used to input a double is the scanner method used to input a one word String. is the Scanner method used to input a one line String. 4,- 5. PART 2 DIRECTIONS: Fill in the missing code in each blank Scanner keyboard new Scanner (System.in): int intone-0 double doubleOne-o short shortOne 0; byte byteone-0 i out print ("Enter an integer intone out.print("Enter a double :: doubleone . out.print( Enter a short shortone- out print ("Enter a byte byteone C A Computer Science-Input Worksheet-www.apluscompsci.comExplanation / Answer
All PART 1 answers are correct
__________________________________________________________________________________________________
PART 2
Scanner class object created is: keyboard
(1) Reading an integer
Scanner class method nextInt() reads a single integer value from console
intOne = keyboard.nextInt();
__________________________________________________________________________________________________
(2) Reading a double
Scanner class method nextDouble() reads a single double value from console
doubleOne = keyboard.nextDouble();
__________________________________________________________________________________________________
(3) Reading a short
Scanner class method nextShort() reads a short value from console
shortOne = keyboard.nextShort();
__________________________________________________________________________________________________
(4) Reading a byte
Scanner class method nextByte() reads a byte from console
byteOne = keyboard.nextByte();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.