Pseudocode Pretest 24-25

Flashcard
•
Computers
•
11th Grade
•
Hard
Wayground Content
FREE Resource
Student preview

28 questions
Show all answers
1.
FLASHCARD QUESTION
Front
After running the following code segment, what is contained in the array data?
Back
2.
FLASHCARD QUESTION
Front
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
}
}
Back
Mystery displays the index of every occurrence of the value n in the list.
3.
FLASHCARD QUESTION
Front
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()
}
}
Back
4.
FLASHCARD QUESTION
Front
Which of the following best describes the result of running the procedure below?
PROCEDURE mystery (a, b, c)
{
IF ( a >= b AND a >= c)
{
RETURN (a)
}
ELSE IF ( b >= a AND b >= c)
{
RETURN (b)
}
ELSE
{
RETURN (c)
}
}
Back
It returns the largest of the three input values
5.
FLASHCARD QUESTION
Front
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)
Back
17
6.
FLASHCARD QUESTION
Front
Cecelia would like to write an app to help manage a trip to the grocery store. The app will maintain a shopping list (a list of words) of all the items to buy. Describe how Cecelia might use a second list in the app. What else might be tracked? Describe how the list would be used and updated in the app.
Back
Cecilia could keep a separate list to track which of the items on her list she has actually found and placed in her shopping cart. So for example if she had a shopping list called list and list of true/false values called got that is initially filled with false to indicate she hasn’t gotten anything yet. Then as she shops if list[i] is “eggs”, and she got eggs, then the app would update got[i]=true.
Other uses:
List of prices
Date of last purchase
List of categories
7.
FLASHCARD QUESTION
Front
What is contained in the list after running the following program?
```plaintext
i = 1
val = 0
n = LENGTH(data)
REPEAT n TIMES
{
val = val + data[i]
data[i] = val
i = i + 1
}
```
Back
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Random Sampling Techniques

Flashcard
•
11th - 12th Grade
15 questions
Rational Root Theorem and Factor Theorem

Flashcard
•
11th Grade
15 questions
SST-501 8/28

Flashcard
•
11th Grade
15 questions
Samples and Studies

Flashcard
•
11th - 12th Grade
17 questions
[9] Intro to Programming - AP CSP Unit 2 Review(victoria_craig_47436))

Flashcard
•
10th Grade
20 questions
Programming2-Q2-Assessment

Flashcard
•
12th Grade
15 questions
5-4 Inequalities In One Triangle

Flashcard
•
10th - 11th Grade
15 questions
Sampling Design

Flashcard
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade