Search Header Logo
AP Computer Science Principles Procedures

AP Computer Science Principles Procedures

Assessment

Presentation

Computers

9th - 12th Grade

Medium

Created by

David Guy

Used 129+ times

FREE Resource

3 Slides • 9 Questions

1

AP Computer Science Principles Procedures

by David Guy

2

​Procedures

media

3

​Procedures

media

4

Multiple Choice

Question image

The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answeranswer   for four questions on a quiz, what is displayed?

1

Wrong Wrong Correct Wrong

2

True True False True

3

Correct Correct Wrong Correct

4

Correct Wrong Correct

5

Multiple Choice

Question image

Consider the following procedures. What is displayed as a result of the procedure call proc2("birthday", "to you") ?

1

birthday happy to you

2

birthday happy birthday

3

to you birthday happy

4

to you happy birthday

6

Multiple Choice

Question image

In the procedure Mystery below, the parameter number is a positive integer. Which of the following best describes the result of running the procedure Mystery?

1

The procedure returns true when the initial value of number is 2, and it otherwise returns false.

2

The procedure returns true when the initial value of number is greater than 2, and it otherwise returns false.

3

The procedure returns true when the initial value of number is even, and it otherwise returns false.

4

The procedure returns true when the initial value of number is odd, and it otherwise returns false.

7

Multiple Choice

Question image

Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g. 1,2,3...) Which of the following shows a POSSIBLE result of calling the procedure?

1
2
3
4

8

Multiple Choice

Question image
1

The procedure returns nothing because it will not terminate.

2

The procedure returns the value of 2 * n.

3

The procedure returns the value of n * n.

4

The procedure returns the sum of the integers from 1 to n.

9

Multiple Choice

Question image

Determine what is printed by the following code.

1

8

2

-16

3

-12

4

16

10

Multiple Choice

Question image

A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended. Which of the following best describes the result of running the procedure?

1

The procedure returns TRUE when the user inputs the value "y" and returns FALSE otherwise.

2

The procedure returns TRUE when the user inputs the value "n" and returns FALSE otherwise.

3

The procedure returns TRUE no matter what the input is.

4

The procedure returns FALSE no matter what the input is.

11

Multiple Choice

Question image

1
2
3
4

12

Multiple Choice

Question image

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing toward the top of the grid. Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

1
2
3
4

AP Computer Science Principles Procedures

by David Guy

Show answer

Auto Play

Slide 1 / 12

SLIDE