Comp Sci Unit 3 #7

Comp Sci Unit 3 #7

11th Grade

10 Qs

quiz-placeholder

Similar activities

Boolean Logic

Boolean Logic

9th - 12th Grade

10 Qs

Logic APCSP

Logic APCSP

9th - 12th Grade

10 Qs

AP CSP Booleans

AP CSP Booleans

9th - 12th Grade

10 Qs

Unit 2 Review

Unit 2 Review

9th Grade - University

10 Qs

Course Description Practice Test

Course Description Practice Test

9th - 12th Grade

14 Qs

Karel Quiz Review

Karel Quiz Review

9th - 12th Grade

8 Qs

Alpha Task Code Quiz Check in

Alpha Task Code Quiz Check in

9th - 12th Grade

10 Qs

Boolean Logic

Boolean Logic

9th - 12th Grade

10 Qs

Comp Sci Unit 3 #7

Comp Sci Unit 3 #7

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Nick Nessralla

Used 13+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following grid contains a robot represented as a triangle, which is initially in the bottom-left square of the grid and facing the top of the grid. The robot can move into a white or a gray square but cannot move into a black region.


The following code segment implements an algorithm that moves the robot from its initial position to the gray square and facing the top of the grid.

When the robot reaches the gray square, it turns around and faces the bottom of the grid. Which of the following changes, if any, should be made to the code segment to move the robot back to its original position in the bottom-left square of the grid and facing toward the bottom of the grid?

Interchange the ROTATE_RIGHT and the ROTATE_LEFT blocks.

Replace ROTATE_RIGHT with ROTATE_LEFT.

Replace ROTATE_LEFT with ROTATE_RIGHT.

No change is needed; the algorithm is correct as is.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The grid below contains a robot represented as a triangle, initially facing up. 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 otherwise.

Repeated Until (GoalReached () )

{

<Missing Code>

}

Which of the following replacements for Missing Code can be used to move the robot to the gray square?

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing right.

Consider the procedures below.

 

Which of the following code segments will move the robot to the gray square?

Media Image
Media Image
Media Image
Media Image

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The program segment below is intended to move a robot in a grid to a gray square. The program segment uses the procedure GoalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise. The robot in each grid is represented as a triangle and is initially facing left. The robot can move into a white or gray square but cannot move into a black region.

Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom right square of the grid and facing toward the top of the grid.

The following programs are each intended to move the robot to the gray square. Program II uses the procedure , which returns  if the robot is in the gray square and returns False

 otherwise.

Which of the following statements is true?

Program I correctly moves the robot to the gray square, but program II does not.

Program II correctly moves the robot to the gray square, but program I does not.

Both program I and program II correctly move the robot to the gray square.

Neither program I nor program II correctly moves the robot to the gray square.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the center square of the grid and facing toward the top of the grid.

The following code segment is used to move the robot within the grid.

A gray square represents a possible final location of the robot after the code segment is executed. Which of the following represents all possible final locations for the robot?

Media Image
Media Image
Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following grid contains a robot represented as a triangle. The robot is initially facing right.

Which of the following code segments can be used to move the robot to the gray square along the path indicated by the arrows?

Media Image
Media Image
Media Image
Media Image

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?