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
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
CPU Architecture - DG
Flashcard
•
10th Grade
15 questions
What is the Limit?
Flashcard
•
11th Grade
22 questions
Living in a Technological World
Flashcard
•
11th Grade
20 questions
Blizzard Conditions
Flashcard
•
11th Grade
18 questions
Photography Exam review
Flashcard
•
9th - 12th Grade
24 questions
Innovation and R&D Flashcard
Flashcard
•
11th Grade
Popular Resources on Wayground
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
15 questions
Solving Equations with Variables on Both Sides Review
Quiz
•
8th Grade