Font size
WorksheetsAP April Review
Total questions: 58
Worksheet time: 1hrs 20mins
The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answer for four questions on a quiz, what is displayed?
Wrong Wrong Correct Wrong
True True False True
Correct Correct Wrong Correct
Correct Wrong Correct
Consider the following procedures. What is displayed as a result of the procedure call proc2("birthday", "to you") ?
birthday happy to you
birthday happy birthday
to you birthday happy
to you happy birthday
In the procedure Mystery below, the parameter number is a positive integer. Which of the following best describes the result of running the procedure Mystery?
The procedure returns true when the initial value of number is 2, and it otherwise returns false.
The procedure returns true when the initial value of number is greater than 2, and it otherwise returns false.
The procedure returns true when the initial value of number is even, and it otherwise returns false.
The procedure returns true when the initial value of number is odd, and it otherwise returns false.
Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g. 1,2,3...) Which of the following shows a POSSIBLE result of calling the procedure?
The procedure returns nothing because it will not terminate.
The procedure returns the value of 2 * n.
The procedure returns the value of n * n.
The procedure returns the sum of the integers from 1 to n.
Determine what is printed by the following code.
8
-16
-12
16
A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended. Which of the following best describes the result of running the procedure?
The procedure returns TRUE when the user inputs the value "y" and returns FALSE otherwise.
The procedure returns TRUE when the user inputs the value "n" and returns FALSE otherwise.
The procedure returns TRUE no matter what the input is.
The procedure returns FALSE no matter what the input is.
The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing toward the top of the grid. Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?
ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter “G” is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table above.
ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the binary (base 2) number 1010100?
N
P
T
W
Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
22
37
41
82
What value does the above code segment display?
17
36
53
No value is ever displayed because the algorithm repeats the REPEAT UNTIL block indefinitely.
The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answers for four questions on a quiz, what should their overall score be?
25%
50%
75%
100%
ASCII is a character-encoding scheme that uses 7 bits (8 bits if you are using the extended ASCII table) to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table above.
Which ASCII character is represented by the binary (base 2) number 1000001?
A
B
C
D
Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?
Select two answers.
20
30
40
50
I. Programs written in a high-level language are generally easier for people to read than programs written in a low-level language.
II. A high-level language provides programmers with more abstractions than a low-level language.
III. Programs written in a high-level language are generally easier to debug than programs written in a low-level language.
Which of the following would pose the greatest threat to a user’s personal privacy if it were to be leaked to the public?
The IP address of the user’s computer
The user’s browser cookies
The user’s email address
The user’s private key used for encryption
Consider the process of encoding and decoding a message using the following Caesar cipher encoding scheme in which the plaintext and ciphertext alphabets are offset by four positions, as shown above.
Which of the following encoded ciphertext strings decodes to an original plaintext message of “secret”?
ersecr
wigvix
kwujwl
oaynap
What is the decimal equivalent of 11010011?
211
210
209
208
What is % in JavaScript?
Square Root
Modulus
Add
Square Root
What is the RGB value of red?
(255,0,0)
(255,0,255)
(255,255,0)
(0,0,255)
Which of the following refers to the runtime of algorithms with exponential or factorial efficiencies?
a) Reasonable Time
b) Heuristic
c) Unreasonable Time
d) Efficiency
Which of the following is a model in which programs are broken into small pieces, some of which are run simultaneously on a single device?
a) Distributed Computing
b) Sequential Computing
c) Parallel Computing
d) Speedup
What is an Event?
An action that causes something to happen
An action that doesn’t do anything in the App
An action that will allow you to look up and event
Something that is happening in the calendar
A flowchart is a way to visually represent an algorithm. The flowchart above uses the building blocks from the table above.
Which of the following statements best describes the behavior of the algorithm depicted in the flowchart?
Assume a always starts greater than b.
It displays the sum of a and b.
It displays the difference between a and b.
It displays the product of a and b
It runs in an infinite loop.
This flowchart is made to ...
Check whether a number is odd or even
Decide if we like a number or not
Calculate the remainder of a number + 2
Help people with Maths
3
6
10
18
It will be different each time you run it
All done.
Inside the If.
Inside the if.
All done.
Inside the else.
All done.
Inside the if.
Inside the else.
All done.
3
6
10
18
It will be different each time you run it
y + z + " and " + x
sentence
BoysHello Girls
Hello Boys and Girls
Hello Girls and Boys
Inside first if
Inside second if
Inside first if
Inside second if
Nothing will be printed
It will be different each time
9
21
81
nothing is printed
this script would cause an error
What is displayed as a result of executing the code segment?
true false false
true false true
true true false
true true true
What is repetition?
Sequence
Selection
Iteration
A diagram that is representation of an algorithm is ....
Flowchart
Pseudocode
System
Component
Which description best describes what this program does?
This program sums up the integers from 8 to 15 (inclusive).
This program sums up the integers from 2 to 8 (inclusive).
This program multiplies the integers from 8 to 15 (inclusive).
This program sums up the integers from 8 to 14 (inclusive).
