Procedures Practice Part 2

Procedures Practice Part 2

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Threats to Data

Threats to Data

9th - 12th Grade

11 Qs

HEALTH AND SAFETY 9

HEALTH AND SAFETY 9

7th - 9th Grade

11 Qs

IT- Revision

IT- Revision

9th Grade

10 Qs

OCR GCSE CS - 2.1 ERL sorts and searches

OCR GCSE CS - 2.1 ERL sorts and searches

10th - 11th Grade

9 Qs

MEDIA AND INFORMATION LITERACY

MEDIA AND INFORMATION LITERACY

12th Grade

10 Qs

To Change or Not to Change?

To Change or Not to Change?

12th Grade

10 Qs

networks

networks

11th Grade

10 Qs

Grade 12 1st Quarter Computer Science Summative Assessment

Grade 12 1st Quarter Computer Science Summative Assessment

12th Grade

11 Qs

Procedures Practice Part 2

Procedures Practice Part 2

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

David Guy

Used 28+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

In the following procedure, the parameter str is a string and the parameter num is a number.

Consider the following code segment.

printArgs("**", 1)

printArgs("*", 2)

What is displayed as a result of executing the code segment?

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

Media Image

In the following procedure, the parameter age represents a person’s age. The procedure is intended to return the name of the age group associated with age. People who are under 18 are considered minors, people who are 65 and older are considered senior citizens, and all other people are considered adults. The procedure does not work as intended.

Removing which two lines of code will cause the procedure to work as intended?

Select two answers.

Line 3

Line 8

Line 10

Line 15

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

A student wrote the following procedure to calculate the sum of the integers from 1 to 5.

The student later decides to modify the procedure to calculate the sum of the integers from 1 to max, which represents any positive integer greater than 1.

Which of the following changes should be made to the procedure to meet the student’s goal?

  1. I. The procedure should take max as an input parameter.

  2. II. The condition in the REPEAT UNTIL block should be changed to count > max.

  3. III. The condition in the REPEAT UNTIL block should be changed to max < 5.

I only

II only

I and II

I and III

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region.

Consider the procedure MoveAndTurn below.

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

Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

A red triangle is pictured below in a grid of squares. It is currently facing upward, and can only move using the MoveTriangle procedure, shown below. The triangle can move onto white and gray squares, but not onto the black squares.

Which of the following instructions will get the red triangle to the gray square?

Media Image
Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Code for the procedure Enigma is shown below. Assume that the parameter n has been assigned a positive integer value.

Which of the following shows a possible result of calling the procedure?

Media Image
Media Image
Media Image
Media Image

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?