WorksheetsAP CSP Unit 3: Intro to App Design - Review Questions
Total questions: 28
Worksheet time: 14mins
Which activity is most helpful early in the app development process?
Writing the entire final program code
Interviewing or observing potential users
Deciding on the final background color
Creating detailed comments for every line of code
What is the primary purpose of a design specification?
Listing all the variable names to be used in the program
Explaining the errors found during the final test run
Describing the requirements and user interaction for the program
Writing the actual code that performs the app's functions
Consider the following code snippet. What is the final background color of the "mainScreen"?
Red
Blue
White (default)
Green
In the following code, what is the THIRD and final thing displayed in the console if the user clicks the "myButton" once?
banana
carrot
apple
In the following code, what is the FIRST thing displayed in the console if the user clicks the "myButton" once?
banana
carrot
apple
In the following code, what is the SECOND thing displayed in the console if the user clicks the "myButton" once?
banana
carrot
apple
Which line of code will MOST LIKELY result in an error?
console.log("Result:");
console.log(100);
console.log(Result);
console.log("100");
A program is created to calculate an average grade. The user enters three grades and clicks a "Calculate" button. What serves as the Input in this scenario?
The "Calculate" button being clicked
The final average grade displayed on screen
Which option best distinguishes event-driven from sequential programming?
Sequential code runs faster; event-driven code runs slower.
Sequential code has fewer errors; event-driven code has more errors.
Sequential commands run in written order; event-driven commands run based on user action.
Event-driven programming is only for web apps; sequential is for all other apps.
What is NOT a benefit of adding comments to your code?
Helps other programmers understand how the code was written.
Helps a programmer debug issues in their own code later.
Documents the purpose of complex blocks of code.
They cause the program to run faster on the computer.
In pseudocode, if the instruction DISPLAY("A") is immediately followed by DISPLAY("B"), what is the output?
AB
B A
A B
A then a new line then B
In the pseudocode expression x ← 5 + 3, what is the final value stored in the variable x?
5 + 3
8
x
5
What is the most significant benefit of using pseudocode when planning a program?
It can be run on any computer instantly without installation.
It prevents all errors in the final written program.
It can represent coding concepts common to many programming languages.
It automatically translates into the final programming language code.
What is displayed after the following pseudocode runs?
DISPLAY ("Smile")
DISPLAY ("Now")
SmileNow
Smile Now
Now Smile
Smile
Now
What does the onEvent() block in event-driven programming specify?
The order in which the program's initial commands run
What code should run when a user interacts with a specific element
How quickly the program should execute its functions
The variable names that need to be used in the program
What will be displayed in the console when this program finishes running?
55
5
"5"
5
"5"
5
Which of the following is an example of an event in event-driven programming?
Assigning a value to a variable
The user clicking a button
Running a calculation
The program starting up
Which of the following is NOT a helpful action when debugging a program?
Using comments to "turn off" sections of code to isolate a bug
Printing variable values to the console to check their status
Writing out the entire final code without testing any small sections
Running the program with different inputs to reproduce the error
What is the final value of the variable count after this pseudocode runs?
count ← 10
count ← count + 5
10
5
15
105
In a text-based programming language, what is the best way to temporarily ignore a line of code during debugging?
Delete the line entirely
Move the line to the bottom of the code
Add a comment symbol (like // or #) at the start of the line
Change the line's background color
What is displayed after this pseudocode runs?
DISPLAY(":")
DISPLAY(")")
: )
":" ")"
:)
:
)
In the code snippet below, what is the last property change applied to the "titleLabel"?
The color is set to "red"
The color is set to "blue"
The font-size is set to 20
The font-size is set to the default value
Which term best describes the input given to a program?
The final screen the user sees
The background calculations the program performs
The documentation and comments in the code
The data or action provided by the user (e.g., text, button click)
If an AP CSP pseudocode instruction is a ← b, and b has the value 10, what is the value of a immediately after the instruction runs?
A. 10
B. b
C. The value of a remains unchanged.
D. An error occurs.
What programming concept involves writing code that reacts to specific occurrences like a mouse click or key press?
Sequential Flow
Debugging
Event-Driven Programming
Iterative Development
In JavaScript, which of the following is correctly identified as a String data type?
true
2.5
78
"true"
Which JavaScript value below is correctly identified as a Number data type, which can be used for mathematical operations?
'42'
"Hello"
Why would a programmer store a U.S. phone number (e.g., "(555) 555-1234") as a String instead of a Number in JavaScript?
The value is too long and will exceed the maximum value for a Number.
The Number data type can only store integers (whole numbers).
The value contains characters (parentheses and hyphens) that are not numerical digits.
Strings use less memory than Numbers in modern programming languages.
