CS 2 Unit 1 Review

CS 2 Unit 1 Review

9th - 12th Grade

14 Qs

quiz-placeholder

Similar activities

Quiz Excel 3

Quiz Excel 3

10th Grade

10 Qs

Traffic Light Project Quiz

Traffic Light Project Quiz

9th Grade

17 Qs

Cell Phone Vocabulary

Cell Phone Vocabulary

9th - 12th Grade

12 Qs

Vocabulary of Computer

Vocabulary of Computer

12th Grade

15 Qs

Función CONTAR

Función CONTAR

KG - Professional Development

10 Qs

Networking Quiz

Networking Quiz

8th - 9th Grade

15 Qs

Arduino

Arduino

7th - 9th Grade

15 Qs

HARDWARE AND SOFTWARE

HARDWARE AND SOFTWARE

2nd - 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

Create a free account and access millions of resources

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?