
Unit 5 code.org Review
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Ms Seccafico
Used 148+ 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"
Create a free account and access millions of resources
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
16 questions
OCR Sys Arch J277
Quiz
•
10th - 12th Grade
14 questions
ITGS - IT Systems (Hardware)
Quiz
•
10th - 12th Grade
15 questions
Internet Basics
Quiz
•
5th Grade - University
13 questions
ICT and Retail Industry
Quiz
•
8th - 12th Grade
10 questions
Computer Aided Design
Quiz
•
11th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
10 questions
IT Quiz
Quiz
•
11th - 12th Grade
20 questions
Design your website
Quiz
•
7th - 12th 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
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
20 questions
christmas songs
Quiz
•
KG - University
