Pseudocode Pretest 24-25

Flashcard
•
Computers
•
11th Grade
•
Hard
Quizizz 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
20 questions
Roles of the President

Flashcard
•
10th - 12th Grade
20 questions
AP CSP Unit 6

Flashcard
•
11th Grade
18 questions
AP CSP Review

Flashcard
•
11th - 12th Grade
21 questions
AP CSP Unit 2 CMU Review Flashcardizz

Flashcard
•
11th Grade
20 questions
Python Math & Random Review

Flashcard
•
9th - 12th Grade
20 questions
JavaScript Flashcard 2

Flashcard
•
9th - 12th Grade
22 questions
Code.org CSP Unit 4 Review (22-23)

Flashcard
•
9th - 12th Grade
25 questions
OnShape: Introduction to Sketching

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade