
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
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
14 questions
Topologías de red!
Quiz
•
12th Grade
12 questions
KTCK 2 - TIN HOC 9 - TRAC NGHIEM
Quiz
•
9th Grade
10 questions
Tin học 10 _ Bài 16 _Định dạng văn bản
Quiz
•
10th - 12th Grade
10 questions
TIN 11 - PYTHON - PHÉP TOÁN - BIỂU THỨC - CÂU LỆNH GÁN
Quiz
•
11th Grade
10 questions
QBASIC Programming
Quiz
•
5th - 10th Grade
18 questions
TEST Bài 1_K12_Sách KNTT
Quiz
•
12th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
15 questions
Adivina quien?
Quiz
•
1st - 10th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
