Array Practice - AP CSP

Array Practice - AP CSP

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Hour of Code

Hour of Code

2nd - 12th Grade

10 Qs

Know thy Peer-to-Peer

Know thy Peer-to-Peer

12th Grade

10 Qs

MIL March 8, 2023

MIL March 8, 2023

12th Grade

10 Qs

Komputer Akuntansi

Komputer Akuntansi

11th Grade

10 Qs

CODE: MAZE INTRO

CODE: MAZE INTRO

7th - 10th Grade

10 Qs

Input and Output Python

Input and Output Python

10th Grade

10 Qs

Access - Lesson 14

Access - Lesson 14

9th - 12th Grade

10 Qs

ICT 10 : Introduction to Adobe Illustrator(CS5)

ICT 10 : Introduction to Adobe Illustrator(CS5)

10th Grade

10 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