
Big Idea 3 (Portion) Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
Danzel Umapas
Used 1+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following code segment.
x ← 25
y ← 50
z ← 75
x ← y
y ← z
z ← x
Which of the variables have the value 50 after executing the code segment?
Responses
x and z
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following code segment.
red ← blue
blue ← yellow
red ← red
blue ← blue
What are the values of first and second as a result of executing the code segment?
blue and red
yellow
blue and red
no changes
3.
MULTIPLE CHOICE QUESTION
45 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?
i
h
f
e
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following code segment.
firstList ← ["guitar", "drums", "bass"]
secondList ← ["flute", "violin"]
thirdList ← []
thirdList ← firstList
firstList ← secondList
secondList ← thirdList
What are the contents of secondList after the code segment is executed?
["flute", "violin", "guitar", "drums", "bass"]
["flute", "violin"]
["guitar", "drums", "bass"]
[]
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following code segment. (see attached image)
What is displayed as a result of executing the code segment?
10 20 30 40
21 30 40 50
21 40 30 40
21 40 30 50
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
x = 23
z = x mod y
Which of the following initial values of the variable y would result in the variable z being set to 2 after the code segment is executed?
Responses
1
2
3
4
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following procedures for string manipulation.
(see attached image)
Which of the following code segments can be used to store "noon" in the string variable word ?
word ← "no"
word ← concat(reverse(word), word)
word ← "no"
word ← concat(reverse(word), reverse(word))
word ← "on"
word ← concat(reverse(word), word)
word ← "on"
word ← concat(reverse(word), reverse(word))
8.
MULTIPLE SELECT QUESTION
1 min • 2 pts
Consider the following procedures for string manipulation. (see attached image)
Assume that the string oldString contains at least 4 characters. A programmer is writing a code segment that is intended to remove the first two characters and the last two characters from oldString and assign the result to newString.
For example, if oldString contains "student", then newString should contain "ude".
Which of the following code segments can be used to assign the intended string to newString ?
Select two answers.
newString ← substring(oldString, 3, len(oldString) - 4)
newString ← substring(oldString, 3, len(oldString) - 2)
tempString ← substring(oldString, 3, len(oldString) - 2)
newString ← substring(tempString, 1, len(tempString) - 2)
tempString1 ← substring(oldString, 1, 2)
tempString2 ← substring(oldString, len(oldString) - 2, 2)
newString ← concat(tempString1, tempString2)
9.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
The following code segment is used to determine whether a customer is eligible for a discount on a movie ticket.
val1 ← (NOT (category = "new")) OR (age ≥ 65)
val2 ← (category = "new") AND (age < 12)
If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the code segment?
Responses
val1 = true, val2 = true
val1 = true, val2 = false
val1 = false, val2 = true
val1 = false, val2 = false
Similar Resources on Wayground
10 questions
Python Input/Output

Quiz
•
9th - 12th Grade
13 questions
APCSA Unit 3 Review

Quiz
•
9th - 12th Grade
11 questions
Python Intro 1

Quiz
•
7th - 12th Grade
10 questions
Database Fundamentals

Quiz
•
KG - University
13 questions
Unit 4 AP CSA Review

Quiz
•
12th Grade
10 questions
Python: Functions and Parameters

Quiz
•
9th - 12th Grade
10 questions
Pseudocode WHILE Loops

Quiz
•
10th - 12th Grade
10 questions
Python Boolean and If

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade