NEW
Font size
WorksheetsAP Computer Science Unit 1 Review Questions
Total questions: 20
Worksheet time: 2hrs 31mins
Imagine you are building a program for an online retail store. Which of the following is the most important step to take before you begin writing the code?
Create a logo for the website.
Research the best programming language for your project.
Plan the functions, features, and user experience of your program.
Set up the company’s social media accounts.
Which of the following represents a program's "state"?
The number of times a loop has run.
The position of a sprite on the screen.
The score in a game.
All of the above.
What is the code a programmer writes in a high-level language called?
Binary Code
Executable File
Source Code
Machine Code
A programmer is writing a program to store a user's phone number. What is the most suitable variable type for this information?
Integer
Floating Point
Boolean
String
A program that was running without issues suddenly crashes. After looking at the code, you notice that a variable is not storing the correct value. What process would you use to fix this problem?
Debugging
Compiling
Iterating
Innovating
Which of the following is a step-by-step set of instructions to solve a problem?
A. A process
B. A function
C. A loop
D. An algorithm
Which of the following would be best represented by a Boolean variable?
The name of the user.
Whether a user is logged in.
The user's age.
The number of items in a shopping cart.
Which of the following Scratch blocks would be used to control the flow of a program?
play sound until done
wait () seconds
if () then
change size by ()
Why are well-written algorithms important?
They can only be written by an expert programmer.
They make the program run faster.
They ensure the instructions are perfectly understood and executed.
They are only necessary for complex programs.
In the algorithm below, which statement is a descriptive qualifier?
Put on pants
Put on left shoe
Put on shoe
Put on shirt
put on
shoe
left
pants
Why is the following algorithm ambiguous? "Take all the test scores from the semester and find their average."
It doesn't say what to do with the result.
The term "average" can mean different things (mean, median, mode).
It doesn't specify how many test scores there are.
It doesn't say who the students are.
In the "Sprite Race" project, the program starts the cars at the same position every time. What is one way you could add randomness to this?
Add a forever loop to each car.
Use a go to x: y: block with a pick random operator.
Change the color of the cars.
Use a when key pressed block.
A programmer wants to have a sprite change costumes every time the space key is pressed. Which of the following events would be most appropriate?
when green flag clicked
when backdrop switches to
when [space] key pressed
when I receive
A game developer is creating a program where a player's character can move up, down, left, and right. How many sprites are needed to represent the player's character facing all four directions?
1
2
4
8
What is the benefit of using a block-based language like Scratch over a text-based language?
It is much faster to write code.
It is impossible to make syntax errors.
It can be used to make more complex programs.
It is easier to write on paper first.
A programmer uses a stop all block in their program. What does this block do?
It pauses the program for a short time.
It stops all running scripts in the program.
It deletes all sprites from the stage.
It only stops the script it is in.
What is the most common reason for a program to behave unexpectedly?
Hardware failure
Bugs in the code
Incorrect user input
Lack of comments in the code
What is the best way to make your program readable and easy for other people to understand?
Use many different sprites.
Use descriptive variable names.
Write the code as quickly as possible.
Use a different programming language.
What is abstraction in programming?
Hiding details and complexity to make a program easier to understand.
The process of writing code in a high-level language.
The final step of the iterative development process.
The use of loops to repeat code.
What is a "variable" in programming?
A. A set of instructions.
B. A command that tells the computer to do something.
C. A placeholder to store a specific value or attribute.
D. A set of symbols used to write code.
