APCSP Pseudocode

APCSP Pseudocode

11th - 12th Grade

24 Qs

quiz-placeholder

Similar activities

Python Function - 3

Python Function - 3

12th Grade

20 Qs

L73_118 Prep for Test

L73_118 Prep for Test

12th Grade - University

20 Qs

data rep, boolean logic, memory, storage, binary

data rep, boolean logic, memory, storage, binary

10th - 11th Grade

20 Qs

Intro to Visual Basic

Intro to Visual Basic

10th Grade - University

20 Qs

Season 4 #Spaic Python Weekly Quiz

Season 4 #Spaic Python Weekly Quiz

KG - Professional Development

20 Qs

The Internet (A Level AQA)

The Internet (A Level AQA)

12th Grade

20 Qs

Unit 6 - lesson 2 Network Topology

Unit 6 - lesson 2 Network Topology

10th - 12th Grade

19 Qs

Typing words on keyboard (musical instruments)

Typing words on keyboard (musical instruments)

KG - Professional Development

20 Qs

APCSP Pseudocode

APCSP Pseudocode

Assessment

Quiz

Computers

11th - 12th Grade

Hard

Created by

Thomas Martinez

FREE Resource

AI

Enhance your content in a minute

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

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

After running the following code segment, what is contained in the array data?

Media Image
Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Choose the best description of what the mystery procedure below does. The procedure accepts two parameters: a list of a values and a number n.


PROCEDURE mystery (list, n)

{

i = 1

REPEAT LENGTH(list) TIMES

{

IF ( list[i] = n )

{

DISPLAY (i)

}

i = i+1

}

}

Mystery displays the number at index n.

Mystery displays the index of the first occurrence of the value n in the list.

Mystery displays the index of the last occurrence of the value n in the list.

Mystery displays the index of every occurrence of the value n in the list.

Mystery displays true if n is in the list.

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which of the following best describes the value returned by the procedure below?


PROCEDURE mystery (data)

{

count = 0

i = 1

REPEAT UNTIL (i = LENGTH(data))

{

IF (data[i] < data[i+1])

{

count = count + 1

}

i = i+1

}

DISPLAY(count)

}


The answers below refer to values being in ascending and descending order. Ascending order means increasing, as in: [1, 2, 5, 8]. Descending order means decreasing, as in [20, 15, 7, 3].

The procedure displays true when data is in ascending order

The procedure displays false when data is in descending order

The procedure displays the number of times adjacent items are in ascending order

The procedure displays how long it takes to find two numbers in ascending order

The procedure counts how long it takes to find two numbers in descending order and displays that number

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

A robot starts in a grid facing north (B3). What is the robot's location and direction after the following program is executed?

data = ["F", "F", "R", "F", "L", "F", "R", "R", "F"]

FOR EACH move IN data

{

IF ( move = "F" AND CAN_MOVE(forward) )

{

MOVE_FORWARD()

}

ELSE IF (move = "R"){

rotate_right()

}

ELSE IF ( move = "L") {

rotate_left()

}

}

Media Image
Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which of the following best describes the result of running the procedure below?


PROCEDURE mystery (a, b, c)

{

IF ( a >= b AND a >= c)

{

DISPLAY(a)

}

ELSE IF ( b >= a AND b >= c)

{

DISPLAY(b)

}

ELSE

{

DISPLAY(c)

}

}

mystery displays the smallest of the three input values

It displays the middle of the three input values

It displays the largest of the three input values

It displays the average of the three input values

It always displays c

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

The following program processes the list data shown below. What is the output of the following program?


val = 0

i = 1

REPEAT 3 TIMES

{

val = val + data[i]

i = i + 1

}

DISPLAY (val)

3

9

17

42

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

The following program processes the list data shown below. After running the following program, what is contained in the list?


i = 1

val = 0

n = LENGTH(data)

REPEAT n TIMES

{

val = val + data[i]

data[i] = val

i = i + 1

}

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

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?