
Unit 5 code.org Review
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Ms Seccafico
Used 150+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 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
1 min • 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.
numGlovesVotes ←0
numMittensVotes ← 0
<MISSING CODE>
{
IF(vote = "Gloves")
{
numGlovesVotes ← numGlovesVotes + 1
}
ELSE
{
numMittensVotes ← numMittensVotes + 1
}
}
DISPLAY(numGlovesVotes)
DISPLAY(" shoppers chose gloves and")
DISPLAY(numMittensVotes)
DISPLAY(" shoppers chose mittens.")
Which of the following should replace <MISSING CODE> 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
1 min • 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.
theList ← [9, -1, 5, 2, 4, 8]
x ← theList[index1] + theList[index2]
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
1 min • 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.
i ← 1
REPEAT 10 TIMES
{
<MISSING CODE>
}
Which of the following can be used to replace <MISSING CODE> so that the code segment works as intended?
APPEND(evenList, i)
i ← i + 2
i ← i + 2
APPEND(evenList, i)
APPEND(evenList, 2 * i)
i ← i + 1
i ← i + 1
APPEND(evenList, 2 * i)
5.
MULTIPLE CHOICE QUESTION
2 mins • 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
1 min • 1 pt
Consider the following code segment.
theList ← [-2, -1, 0, 1, 2]
count1 ← 0
count2 ← 0
FOR EACH value IN theList
{
IF(value > 0)
{
count1 ← count1 + 1
}
ELSE
{
count2 ← count2 + 1
}
}
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
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume that both lists and strings are indexed starting with index 1.
The list wordList has the following contents.
["abc", "def", "ghi", "jkl"]
Let myWord be the element at index 3 of wordList. Let myChar be the character at index 2 of myWord. What is the value of myChar ?
"e"
"f"
"h"
"i"
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
19 questions
Hardware and Components
Quiz
•
5th - 11th Grade
20 questions
System Computer : Al-Azhar
Quiz
•
9th - 12th Grade
15 questions
History of Computers
Quiz
•
6th - 12th Grade
16 questions
Python Basics
Quiz
•
KG - University
20 questions
Python Recap
Quiz
•
7th Grade - University
10 questions
Empowerment Technologies
Quiz
•
11th Grade
15 questions
Lua Review Corona SDK with Notepad++
Quiz
•
10th - 12th Grade
10 questions
STM BTEC DIT 3- 5. Maintenance, set-up, performance p152
Quiz
•
9th - 11th 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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
