3. 5th Grade Input Question
What would happen if the following
occurred:
Code:
String name = kboard.nextLine();
Input:
5.0
4. 5th Grade Input Answer
The program will have an exception or
a run-time error. The program
expects the user to input a string but
the user inputs a decimal value.
Return
5. 5th Grade Variables Question
Name the three key components
involved in naming variables.
6. 5th Grade Variables Answer
The type of variable (string, double, int)
The name must be meaningful and
descriptive
No spaces/symbols in the names of
variables
Return
7. 4th Grade Java File Structure
Question
Fill in the missing blanks:
1. Source File
2. _____________
3. Object Code
4. _____________
5. Program
9. 4th Grade Input Question
What two lines of code are required
for writing a java program with input?
10. 4th Grade Input Answer
import java.util.Scanner;
public class program
{
public static void main(String[] args)
{
Scanner kboard = new Scanner(System.in);
}
}
Return
11. 3rd Grade Output Question
What would be outputted by the
following:
int a = 1;
int b = 4;
System.out.println(“ans= “ + a + b);
13. 3rd Grade Errors Question
Classify the following with the type
of error:
1) Forgetting a semi-colon in a command
2) Outputting the addition of 1+3 as 3.
3) Forgetting a brace bracket at the
end of the program
15. 2nd Grade Variables Question
Write statement(s) that declares and
assigns the following values:
mark with a value of 85
words with a value of Computers
temperature with a value of 15.3
17. 2nd Grade Binary Numbers
Question
What are binary numbers, and why
are they used?
18. 2nd Grade Binary Numbers
Answer
Computers are made up of wires and
electronic circuits and control them,
1-on, and 0-off
Used to represent this on/off nature
of the wire.
Return
20. 1st Grade Hardware Answer
RAM – random access memory (can
read-write to this memory, computer
memory)
ROM – read only memory (startup,
only read to this memory)
Return
24. 1,000,000 Question
Write a short program using Java that
will ask the user to input a name.
The program should also ask the user to
enter an adjective.
The program should output a statement
that resembles:
________ (name) is very ____ (adjective).