AP CS A Quiz 4 Practice

AP CS A Quiz 4 Practice

9th - 12th Grade

9 Qs

quiz-placeholder

Similar activities

Електронні таблиці Exel

Електронні таблиці Exel

1st - 12th Grade

12 Qs

Archivos Digitales

Archivos Digitales

9th Grade - University

14 Qs

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Empowerment Technologies Quiz 2

Empowerment Technologies Quiz 2

11th Grade

10 Qs

test 3.6

test 3.6

11th Grade

10 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

social engineering

social engineering

1st Grade - Professional Development

10 Qs

Examen final algoritmo

Examen final algoritmo

11th Grade

12 Qs

AP CS A Quiz 4 Practice

AP CS A Quiz 4 Practice

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Scott Chamberlain

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Given the code shown here, what are the first and last numbers output?

5 11

5 12

6 11

6 12

none (error)

2.

CATEGORIZE QUESTION

3 mins • 7 pts

Organize these statements into the right categories of loops

Groups:

(a) for loop is best

,

(b) while loop is best

,

(c) either type of loop is ok

to use an integer variable to control how many times a loop runs

to stop looping when a certain condition is met

to repeat an entire block of code

to repeat code an extremely large number of times

to control a loop with user input

to perform a series of calculations

when you know the number of iterations ahead of time

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Choose which three values should replace the blanks in the for loop so that it loops through the numbers:

2 7 12 17 22 27

1, <=27, +=2

2, <=27, +=5

5, <27, +=2

2, <27, +=3

0, <=27, +=5

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

How many times will the "while" loop execute in this code?

30

26

22

18

infinite loop

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What changes are needed to the code shown here in order to print the odd numbers from 11 to 25 inclusive?

x+=2 should be x++

x < 25 should be x <= 25

x+=2 should occur after the println

int x = 11 should be int x = 9

correct as is - no changes needed

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the code shown here?

This is an infinite loop

1 2 0 9 5

2 0 9 5 1

9 0 2 1 0

5 9 0 2 1

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Choose which three values should replace the blanks in the for loop so that it loops through the numbers:

11 9 7 5 3 1

11, <=11, --

1, <11, +=2

11, >=1, -=2

11, >1, --

1, <=11, -=2

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?