
Mid-Year Java Check
Authored by Elisa Lovejoy
Computers
8th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which code segment will print “Hello Karel” to the screen in Java?
System.out.printLine("Hello Karel");
print "Hello Karel";
System.out.println("Hello Karel");
System.println("Hello Karel");
system.out.println("Hello Karel");
Answer explanation
System is a class, so it MUST ALWAYS start with an uppercase S.
A String MUST ALWAYS be encapsulated with double quotes [i.e., "This sentence is a string."]
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What will this code segment output?
System.out.println("Hello");
System.out.println("World");
Hello
World
HelloWorld
Hello World
hello
World
Answer explanation
The use of the println command forces a carriage return [like hitting the enter key], therefore the words will appear on a different line.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following is a proper way to declare and initialize a variable in Java?
myInteger = 100;
char = 'a';
int myNumber = 10;
"Variable"
Answer explanation
To declare a variable, you must first use the name for the variable type, then give the variable a name [for example]:
int age;
declares an integer variable type with the name of age
To store a value [initialize] into it the same time as you declare it would be as follows:
int age = 13;
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the below is not a primitive type in Java?
int
char
boolean
double
apple
Answer explanation
At best -- the word "Apple" would be a value stored in a String variable.
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of these input methods is not correct?
readInt
readDouble
readChar
readBoolean
readVariable
Answer explanation
All of the other answers would output a question [which you would write] and expect the proper value-type as a response from the user.
6.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What will this code segment output if the user inputs the number 10?
int yourInteger = readInt("Please input a number");
System.out.println(yourInteger);
yourInteger
“yourInteger”
10
“10”
Answer explanation
When you declare a variable and ask for userinput, then this is what is stored in that variable. Therefore, when the variable is output, the name of it doesn't appear, but rather the value you stored in it.
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the result of this expression?
150 % 100
0
100
50
3
Answer explanation
The % is the modulus operator [sometimes called mod]. It results in the REMAINDER of a division as the answer.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Browser dan CMS
Quiz
•
7th - 9th Grade
20 questions
Administrasi Sistem jaringan KD1
Quiz
•
1st - 10th Grade
20 questions
Responsible Use of Digital Resources
Quiz
•
7th - 8th Grade
25 questions
CPA Inkscape Quiz 01
Quiz
•
7th - 12th Grade
20 questions
CS-9 Chapter-2 Types of Computer Part1: Rabin Ghimire
Quiz
•
8th - 9th Grade
20 questions
икт 21-40
Quiz
•
1st Grade - University
25 questions
TLE Q3 EXAM REVIEWER
Quiz
•
8th Grade
20 questions
SOFTWARE 7I
Quiz
•
7th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade