
Code Segments and Logic Problems

Interactive Video
•
Computers, Education
•
10th - 12th Grade
•
Medium

Emma Peterson
Used 6+ 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
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Improving Chronological Reasoning in History

Interactive video
•
10th - 12th Grade
6 questions
AP World History Exam Insights

Interactive video
•
10th - 12th Grade
11 questions
Game Scoring and Free Response Strategies

Interactive video
•
10th - 12th Grade
11 questions
Sampling Distribution and Regression Concepts

Interactive video
•
10th - 12th Grade
11 questions
Strategies for AP Multiple Choice

Interactive video
•
10th - 12th Grade
11 questions
AP Biology Test Strategies and Guidelines

Interactive video
•
10th - 12th Grade
11 questions
Strategies for Answering Multiple Choice Questions

Interactive video
•
10th - 12th Grade
7 questions
Understanding DBQ and LEQ Prompts

Interactive video
•
9th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Essential Lab Safety Practices

Interactive video
•
6th - 10th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade