CS 2 Unit 1 Review

CS 2 Unit 1 Review

9th - 12th Grade

14 Qs

quiz-placeholder

Similar activities

Wee Word Intro

Wee Word Intro

7th - 12th Grade

12 Qs

Internet

Internet

6th - 12th Grade

13 Qs

Evaluación Final UNDECIMO 11

Evaluación Final UNDECIMO 11

11th Grade

10 Qs

Internet

Internet

10th Grade

12 Qs

ICT 10 : Introduction to Adobe Illustrator(CS5)

ICT 10 : Introduction to Adobe Illustrator(CS5)

10th Grade

10 Qs

PSTS1 Informatika

PSTS1 Informatika

10th Grade

17 Qs

Dispositivos Electrónicos Analógicos y Digitales

Dispositivos Electrónicos Analógicos y Digitales

12th Grade

10 Qs

Ôn lại kiến thức  Lớp 3 T13

Ôn lại kiến thức Lớp 3 T13

1st - 10th Grade

10 Qs

CS 2 Unit 1 Review

CS 2 Unit 1 Review

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Jon Kern

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?