
Code Segments and Logic Problems
Interactive Video
•
Computers, Education
•
10th - 12th Grade
•
Practice Problem
•
Medium
Emma Peterson
Used 7+ times
FREE Resource
Read more
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is provided to students during the AP Computer Science Principles exam to help them understand the code?
A programming language guide
An exam reference sheet
A calculator
A textbook
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code segments correctly assigns a letter grade based on a numeric score?
if score > 90 then grade = 'A' else grade = 'B'
if score > 90 then grade = 'A' else if score >= 80 then grade = 'B' else grade = 'C'
if score >= 80 then grade = 'B' else if score > 90 then grade = 'A' else grade = 'C'
if score < 80 then grade = 'C' else if score <= 90 then grade = 'B' else grade = 'A'
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be displayed if the parameter x is negative in the given procedure?
Nothing
False
Error
True
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does the code segment determine if a list contains duplicate values?
By comparing each element to the element that immediately follows
By comparing each element to the element that immediately precedes
By comparing each element to all subsequent elements in the list
By comparing each element to all other elements in the list
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
For which values of num correct does the code segment not display the intended grade?
8 and 6
7 and 6
9 and 7
9 and 8
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What change should be made to the code segment to ensure it reduces the score by penalty correctly?
Change line 1 to if score < 0
Change line 1 to if score + penalty > 0
Interchange lines 3 and 7
Change line 1 to if score + penalty < 0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the final value of r after executing the given code segment?
20
30
40
10
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
11 questions
Understanding Contact Forces in Physics
Interactive video
•
10th - 12th Grade
6 questions
Matter as a Particle
Interactive video
•
11th Grade - University
6 questions
2012 AP Econ Music Video Competition Results
Interactive video
•
11th Grade - University
8 questions
The Difference Between 3:4 and 6:8 Time Signatures - Music Theory
Interactive video
•
10th - 12th Grade
6 questions
How Going Off Topic Affects IELTS Writing Scores
Interactive video
•
10th Grade - University
6 questions
How to Score Highly in Task Achievement for IELTS Writing Task 2
Interactive video
•
10th Grade - University
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