Array Practice - AP CSP

Array Practice - AP CSP

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Threats to Data

Threats to Data

9th - 12th Grade

11 Qs

HEALTH AND SAFETY 9

HEALTH AND SAFETY 9

7th - 9th Grade

11 Qs

IT- Revision

IT- Revision

9th Grade

10 Qs

OCR GCSE CS - 2.1 ERL sorts and searches

OCR GCSE CS - 2.1 ERL sorts and searches

10th - 11th Grade

9 Qs

MEDIA AND INFORMATION LITERACY

MEDIA AND INFORMATION LITERACY

12th Grade

10 Qs

To Change or Not to Change?

To Change or Not to Change?

12th Grade

10 Qs

networks

networks

11th Grade

10 Qs

Grade 12 1st Quarter Computer Science Summative Assessment

Grade 12 1st Quarter Computer Science Summative Assessment

12th Grade

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?