
Unit 2: Abstraction, Algorithms, List
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Stephannia Kabanakis
Used 12+ times
FREE Resource
Enhance your content in a minute
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
myList ← ["red", "yellow", "green", "blue"]
X ← <MISSING CODE>
DISPLAY(X)
What should <MISSING CODE> be replaced with so that “yellow” is displayed after executing the code?
[2]myList
myList[2]
myList[“yellow”]
“yellow”[myList]
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
numberList ← [2, 5, 8, 1]
X ← numberList[1] + numberList[3]
DISPLAY(X)
What will be displayed after executing the code segment?
10
7
13
3
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
words ← [“hello”, “bye”, “no”, “yes”]
Which of the following is a valid index for the list, words?
5
-1
"bye"
4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A programmer is writing a sports program that handles football teams and their players. Which of the following is the most appropriate data type to represent a collection of different football player’s names?
String
Boolean
Numeric
List
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
firstList ← ["apple", "banana", "orange"]
secondList ← ["grape", "lemon"]
thirdList ← []
thirdList ← firstList
firstList ← secondList
secondList ← thirdList
What are the contents of secondList after the code segment is executed?
[ ]
["apple", "banana", "orange"]
["grape", "lemon"]
["apple", "banana", "orange", "grape", "lemon"]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
numbersList ← [8, 6, 2, 1]
APPEND ( numbersList , 4 )
X ← numbersList[1]
Y ← numbersList[5]
Z ← X MOD Y
DISPLAY (Z)
What displays after the code segment is executed?
4
0
3
1
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a benefit of using a list as a data abstraction in a program?
Lists often allow their size to be easily updated to hold as many data values as needed.
Lists convert all elements to strings so that they can be inspected character-by-character.
Lists prevent duplicate data values from appearing in the list.
Lists are used to store all input data so that there is a running record of all user input.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
App Inventor
Quiz
•
10th Grade
14 questions
Intro to Robotics
Quiz
•
9th Grade
14 questions
4th quarter 2nd summative
Quiz
•
10th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
21 questions
Computer System
Quiz
•
9th - 11th Grade
20 questions
Design your website
Quiz
•
7th - 12th Grade
20 questions
Artificial Intelligence and SketchUp
Quiz
•
8th - 10th Grade
13 questions
INTERNET CONNECTION
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
