
Array Practice - AP CSP
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Christina Perry
Used 4+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
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
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
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?
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?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
Similar Resources on Wayground
10 questions
QBASIC Programming
Quiz
•
5th - 10th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
10 questions
EMPTECH L4 Q3
Quiz
•
12th Grade
10 questions
TQ - Review Quiz Week 1
Quiz
•
9th Grade
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1
Quiz
•
2nd Grade - University
10 questions
Microcontroller
Quiz
•
11th Grade - University
10 questions
Network
Quiz
•
10th - 11th Grade
10 questions
ICT 9 Quiz 1
Quiz
•
9th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
