AP Computer Science A Unit 4 Section 1 (While loops)

AP Computer Science A Unit 4 Section 1 (While loops)

10th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

Two-Dimensional Array in Java

Two-Dimensional Array in Java

10th - 12th Grade

6 Qs

AP CSA 2D Array

AP CSA 2D Array

10th - 12th Grade

6 Qs

APCSA Units 7 & 8

APCSA Units 7 & 8

9th - 12th Grade

10 Qs

CS1 Unit 4

CS1 Unit 4

10th - 12th Grade

5 Qs

CS Discoveries Unit 4

CS Discoveries Unit 4

10th - 12th Grade

5 Qs

Printing in Java

Printing in Java

9th - 12th Grade

8 Qs

CS A U1 Review

CS A U1 Review

12th Grade

8 Qs

Traversing Arrays

Traversing Arrays

10th - 12th Grade

6 Qs

AP Computer Science A Unit 4 Section 1 (While loops)

AP Computer Science A Unit 4 Section 1 (While loops)

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Herman Galioulline

Used 24+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

What, if anything, is printed as a result of executing the code segment?

21

161116

161161

16111621

Nothing is printing because of an infinite loop.

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

What will be the value of count after executing the code segment?

6

5

4

1

0

3.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Media Image

This code segment is intended to store the sum of all multiples of 10 between 10 and 100, inclusive (10 + 20 + ... + 100), in the variable total.


What should /* missing code */ be?

x < 100

x <= 100

x > 10

x >= 10

x != 10

4.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Media Image

This code is intended to print the sum of the digits in num. For example, when num is 12345, the code segment should print 15, which represents the sum 1 + 2 + 3 + 4 + 5.


What should /* missing loop header */ be?

while (num > 0)

while (num >= 0)

while (num > 1)

while (num > 2)

while (num > sum)

5.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Media Image

What, if anything, is printed as a result of executing the code segment?

0

1

2

3

Nothing is printed.