stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
APCSP-Algorithms Flashcards | StudBud
Explore
/
APCSP-Algorithms
APCSP-Algorithms
18 terms
·
StudBud Administration
·
23 plays
Quiz on Algorithms and Coding Logic (Photo by Markus Spiske on unsplash.com)
Flashcards
18 cards
F
Practice quiz
P
Host live
L
Questions
18
Answers
1
After the code runs, what value is stored in result?
8
3
5
11
2
What is a benefit to using pseudocode?
Pseudocode can run in the web browser.
Pseudocode is understood by all computers everywhere.
Pseudocode runs much faster than other programming languages.
Pseudocode represents coding concepts common to all programming languages.
3
After the code runs, what is displayed?
: - D
D-:
::-D
D - :
4
Your algorithm counts the number of words in an essay. Now it must ignore words like "the" and "to". What would you use?
Sequencing
Iteration
None of the above
Selection
5
Which of these correctly expresses that algorithm in pseudocode?
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(result) | n ← 2 }
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(n) | n ← n+2 }
n ← 1 | REPEAT 10 TIMES { result ← n*2 | DISPLAY(result) | n ← n+2 }
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(result) | n ← n+2 }
6
What would be displayed as a result of executing this flowchart algorithm?
0
4 3 2 1
15
10
7
Which of these lines of code displays the month ("03")?
When month is "July" and tuberSize is 1.5
When month is "August" and tuberSize is 1.5
When month is "May" and tuberSize is 1.8
When month is "June" and tuberSize is 1.9
8
After running the code, what will be displayed?
11 12
12 12
11 11
12 11
9
Given input values A = True, B = False, C is False, what is the resulting output X?
True
False
10
What does the raceCars variable store after that code runs?
18, 2, 42, 10, 4, 6, 3
18, 2, 42, 10, 1, 4, 6, 3
18, 2, 42, 10, 4, 1, 6, 3
18, 2, 42, 10, 1, 1, 6, 3
11
What is a benefit to using pseudocode?
Pseudocode represents coding concepts common to all programming languages.
Pseudocode is understood by all computers everywhere.
Pseudocode can run in the web browser.
Pseudocode runs much faster than other programming languages.
12
Will this predicate report TRUE or FALSE:
True
False
13
If we set x to 8 and y to 24, what value will the mystery variable store after running this code?
3
16
24
8
14
After running that code, what does the coolDinos list store?
Torosaurus, Triceratops, Stegosaurus, Ankylosaurus,Supersaurus, Ultrasauros
Torosaurus, Stegosaurus, Ankylosaurus, Supersaurus, Therizinosaurus
Triceratops, Supersaurus, Ankylosaurus, Supersaurus, Therizinosaurus
Torosaurus, Stegosaurus, Ankylosaurus, Ultrasauros, Supersaurus
15
What data type will the following block report?
string
Boolean
list
number
16
What does the program output?
Boaty McBoatFace
Boaty (new line)
BoatyMcBoatFace
McBoatFaceBoaty
17
Following the algorithm below, how would you transform the word "avocado"?
abavobocabadobo
abvobcabdob
avabocabadabo
abavbvobocbcabadbdobo
18
What is the output of this code?
1 0 4 3
1 0 3 3
1 0 1 3
1 0 3 4