
CS 2 Unit 1 Review
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Jon Kern
Used 5+ times
FREE Resource
Enhance your content in a minute
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a primitive type?
int
double
String
boolean
char
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of x after this code runs?
int x = 5;
x = 10;
x = 4;
5
10
4
true
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of myInteger after this line of code is executed?
int myInteger = (int) 5.6;
6
5.6
5
9
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What output will be produced by
System.out.println("Hello");
System.out.println("Karel");
Hello Karel
HelloKarel
Hello
Karel
error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print?
int n = 5;
n ++;
n ++;
n += n;
System.out.println(n);
12
40
14
18
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following would equal 2?
I.
int x = 0;
x ++;
x += x;
II.
int y = 4;
y ++;
y /= 2;
III.
int z = 4;
z += 2;
z /= 2;
I only
II only
III only
I and II only
I, II, and III
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following code is intended to print 8.
int x = 23;
double y = 3;
System.out.println((int)(x / y));
What is printed and why?
7 because the values of x and y are integers so 23 / 3 evaluated to 7
7 because x / y calculates to 7.66 then the cast to an int results in the value getting truncated to 7
8 because the values of x and y are integers so 23 / 3 evaluated to 8
8 because x / y calculates to 7.66 then the cast to an int results in the value getting rounded up to 8
Create a free account and access millions of resources
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
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
15 questions
TEST DE PENSAMIENTO LOGICO
Quiz
•
10th Grade
10 questions
Programacion Orientada a Objetos
Quiz
•
12th Grade - University
11 questions
CAPÍTULO 1 NETWORKING ESSENTIALS
Quiz
•
1st - 12th Grade
17 questions
PSTS1 Informatika
Quiz
•
10th Grade
11 questions
CSS9_Q3M3L1_QUIZ5
Quiz
•
9th Grade
10 questions
Dispositivos Electrónicos Analógicos y Digitales
Quiz
•
12th Grade
10 questions
Activity 1: How well do you know Java?
Quiz
•
9th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
