Comp Sci Unit 3 #9

Quiz
•
Computers
•
11th Grade
•
Easy
Nick Nessralla
Used 16+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following grid contains a robot represented as a triangle, which is initially facing right.
The following code segment is intended to move the robot to the gray square.
<MISSING STATEMENT>
{
REPEAT 4 TIMES
{
MOVE_FORWARD()
ROTATE_RIGHT()
}
ROTATE_LEFT()
MOVE_FORWARD()
ROTATE_RIGHT()
}
Which of the following can be used as a replacement for <MISSING STATEMENT> so that the code segment works as intended?
REPEAT 1 TIMES
REPEAT 2 TIMES
REPEAT 3 TIMES
REPEAT 4 TIMES
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following grid contains a robot represented as a triangle, which is initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region.
Which of the following code segments can be used to move the robot to the gray square?
Responses
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
REPEAT 2 TIMES
{
MOVE_FORWARD()
}
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
REPEAT 8 TIMES
{
MOVE_FORWARD()
}
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
ROTATE_LEFT()
REPEAT 2 TIMES
{
MOVE_FORWARD()
}
ROTATE_LEFT()
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
ROTATE_LEFT()
REPEAT 2 TIMES
{
MOVE_FORWARD()
}
ROTATE_RIGHT()
REPEAT 3 TIMES
{
MOVE_FORWARD()
}
3.
MULTIPLE CHOICE QUESTION
30 sec • 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?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The grid below contains a robot represented as a triangle, initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region.
The code segment below uses the procedure goalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise.
REPEAT UNTIL(goalReached())
{
<MISSING CODE>
}
Which of the following replacements for <MISSING CODE> can be used to move the robot to the gray square?
IF(CAN_MOVE(left))
{
ROTATE_LEFT()
MOVE_FORWARD()
}
IF(CAN_MOVE(forward))
{
MOVE_FORWARD()
ROTATE_LEFT()
}
IF(CAN_MOVE(left))
{
ROTATE_LEFT()
}
MOVE_FORWARD()
IF(CAN_MOVE(forward))
{
MOVE_FORWARD()
}
ELSE
{
ROTATE_LEFT()
}
5.
MULTIPLE CHOICE QUESTION
30 sec • 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
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
What is displayed as a result of executing the code segment?
1 3 5
5 3 1
100 300 500
500 300 100
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
What value is displayed as a result of executing the code segment?
3
4
9
12
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
KS4 - Python Turtle

Quiz
•
9th - 11th Grade
10 questions
Chapter 4 - Latihan

Quiz
•
1st - 12th Grade
7 questions
Algorithms Robots

Quiz
•
9th - 12th Grade
12 questions
Computer Science Level 1 - Blocks with VEXcode VR Course Unit 2

Quiz
•
5th - 12th Grade
10 questions
EV3 Level 2 Quiz

Quiz
•
7th - 12th Grade
10 questions
Spike Level 2

Quiz
•
8th - 12th Grade
8 questions
VEX VR Block Coding Unit 3 - Repeating Behavior

Quiz
•
9th - 12th Grade
11 questions
Computing Creative Design Quiz

Quiz
•
2nd Grade - University
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
19 questions
Handbook Overview

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

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

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

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade