Array Practice - AP CSP

Array Practice - AP CSP

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Bildbearbeitung

Bildbearbeitung

8th Grade - University

10 Qs

Computer Security

Computer Security

8th - 10th Grade

10 Qs

Computer Basics 2 - CESA

Computer Basics 2 - CESA

7th Grade - University

10 Qs

Chapter 8 Week 1

Chapter 8 Week 1

9th - 12th Grade

11 Qs

Printers

Printers

9th - 12th Grade

10 Qs

Technical Terms - Internet (A-Z) - Captcha

Technical Terms - Internet (A-Z) - Captcha

12th Grade

10 Qs

Cloud Computing

Cloud Computing

11th Grade

10 Qs

Stuff

Stuff

KG - Professional Development

11 Qs

Array Practice - AP CSP

Array Practice - AP CSP

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Christina Perry

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

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

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is displayed as a result of executing the code segment?

1 3 5

5 3 1

100 300 500

500 300 100

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Shoppers at a mall were asked whether they preferred wearing gloves or mittens in cold weather. Shoppers’ preferences were stored in the list voteList as strings, with the string "Gloves" representing a preference for gloves and the string "Mittens" representing a preference for mittens. The following code segment is intended to traverse the list and display the number of shoppers who chose gloves and the number of shoppers who chose mittens.

Which of the following should replace so that the code segment works as intended?

IF(vote ≤ LENGTH(voteList))

FOR EACH vote IN voteList

REPEAT LENGTH(voteList) TIMES

REPEAT UNTIL(vote > LENGTH(voteList))

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code segment. Assume that index1 is a number between 1 and LENGTH(theList), inclusive, and index2 is a number between 2 and LENGTH(theList) - 1, inclusive.

What is the largest possible value that the variable x can have after the code segment executes?

17

14

11

4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code segment, which is intended to store ten consecutive even integers, beginning with 2, in the list evenList. Assume that evenList is initially empty.

Which of the following can be used to replace so that the code segment works as intended?

Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A teacher stores the most recent quiz scores for her class in the list scores. The first element in the list holds the maximum possible number of points that can be awarded on the quiz, and each remaining element holds one student’s quiz score. Assume that scores contains at least two elements. Which of the following code segments will set the variable found to true if at least one student scored the maximum possible number of points on the quiz and will set found to false otherwise?

Media Image
Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What are the values of count1 and count2 as a result of executing the code segment?

count1 = 2, count2 = 2

count1 = 2, count2 = 3

count1 = 3, count2 = 2

count1 = 5, count2 = 0

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?