NEW
Font size
S
M
L
XL
WorksheetsAP CSP Programming Basics
Total questions: 30
Worksheet time: 29mins
Name
Class
Date
1.
Which of the following statements describes a limitation of using a computer simulation to model a real-world object or system?
a)
Computer simulations can only be built after the real-world object or system has been created.
b)
Computer simulations only run on very powerful computers that are not available to the general public.
c)
Computer simulations usually make some simplifying assumptions about the real-world object or system being modeled.
d)
It is difficult to change input parameters or conditions when using computer algorithms.
2.
How many times will this loop iterate?
a)
4
b)
7
c)
5
d)
6
3.
Which are true regarding high-level and low-level programming languages?
I. High-level can be more abstract
II. Low-level is harder to find errors
III. High-level is more easily understood by humans.
I. High-level can be more abstract
II. Low-level is harder to find errors
III. High-level is more easily understood by humans.
a)
I and II
b)
I, II, and III
c)
II and III
d)
III only
4.
How many binary digits are needed to write the decimal number 999?
a)
8
b)
9
c)
10
d)
11
5.
What is true regarding programming documentation (use of comments, notations, etc.)
a)
It should not be changed after it is first written.
b)
It helps during initial program development and also when modifications are made
c)
It is only needed during program development, not after completion
d)
It is only useful for collaboration, not independent programming.
6.
Which of the following is an example of abstraction?
a)
Writing a function for code you repeat often
b)
Using logic symbols like < and >
c)
Numbers are converted from one base to another
d)
There is an error in the code
7.
Which of the following tasks would best be accomplished by a LOOP?
a)
Drawing a circle of any size on the screen
b)
Drawing a hexagon (6 sided shape)
c)
Drawing out the letters of the word "HELLO"
d)
Determining whether a number is odd or even
8.
Which of the following would best be accomplished by a function?
a)
Drawing out the letters of a word
b)
Drawing 100 tiny dots in a line
c)
Determining if a variable is true or false
d)
Drawing a pentagon
9.
Which of the following would best be executed by a loop?
a)
Drawing 500 squares in a line
b)
Calculating the sum of two numbers
c)
Determining which set of steps to execute next
d)
Drawing the letters in your name
10.
A programmer is writing a system that is intended to be able to store large amounts of personal data. As the programmer develops the data system, which of the following is LEAST likely to impact the programmer's choices in designing the structure of the system?
a)
Maintaining privacy of the information stored in the data set.
b)
Scalability of the system.
c)
Structuring the metadata of the information for analysis.
d)
The frequency of a particular item occurring in a data set.
11.
Programming languages have some similarities and differences to the “natural” language you use in everyday speech. Select the true statement about programming languages:
a)
Compared to the number of words in a natural language, the number of defined words in a programming language is very small.
b)
The number of defined words in a programming language is about the same as the number of words in a natural language.
c)
There are typically many possible ways to interpret an instruction written in a programming language.
d)
The number of defined words in natural language is very small compared to programming language
12.
For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a hexagon (six-sided shape)
a)
Loop
b)
Function(s)
13.
For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing 100 tiny dots in a line
a)
Loop
b)
Function(s)
14.
For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task:Drawing a circle of any size at any point on the screen
a)
Loop
b)
Function(s)
15.
Why are parameters useful when programming?
a)
Parameters determine the number of times the function will run.
b)
Parameters allow for more flexible, generalized behaviors in functions.
c)
Parameters are useful for teams of programmers because they help define the boundaries of the problem they are trying to solve.
d)
Parameters change the order of operations within a function.
16.
When programmers work together, what is an example of how abstraction in programming can promote collaboration?
a)
Team members can rely on one another to explain their code.
b)
Programmers can write functions without needing to know what they do or how they should work.
c)
Programmers can use functions created by their partners, relying on the functionality without needing to know the specific details of how the function is implemented.
d)
In order for programmers to work together, they must work in the same room.
17.
A bakery collects data on sales. Each sales record includes the date of the sale and some metadata about the items that were part of the sale. The data includes: the names of the items sold, the types of items sold, the number of each item sold, and the price of each item sold. Which of the following CANNOT be determined from the bakery's data set?
a)
The total income from sales the bakery received in the past month.
b)
Which customer most frequently purchases bread.
c)
The item bought in the highest quantity in the past week.
d)
Days when certain items sell the most.
18.
An action that causes something to happen.
a)
Event
b)
Parameter
c)
Call
d)
Program
19.
A program designed to run blocks of code or functions in response to specified events (e.g. a mouse click)
a)
Event-driven Program
b)
Action-driven Program
c)
Response-driven Program
d)
User-driven Program
20.
Finding and fixing problems in your algorithm or program
a)
debugging
b)
hacking
c)
cracking
d)
problem solving
21.
A placeholder for a piece of information that can change
a)
Variable
b)
Proxy
c)
Element
d)
Condition
22.
The common programming structure that implements "conditional statements"
a)
If-statements
b)
When-statements
c)
Then-statements
d)
Command-statements
23.
A single value of either TRUE or FALSE
a)
Boolean
b)
Julian
c)
Null
d)
Conditional
24.
What is a sequence of instructions which enables a computer to perform a desired task?
a)
program
b)
compiler
c)
assembly
d)
algorithm
25.
What is the process that a programmer uses to identify errors and make corrections to a program that does not perform the way it was intended or produces incorrect results?
a)
Debugging
b)
Executing
c)
Testing
d)
Compiling
26.
What is a list of steps that you can follow to finish a task?
a)
commands
b)
wires
c)
algorithm
d)
program
27.
What step is missing?
a)
Multiply the number by 2.
b)
Divide the number by 2.
c)
Multiply the number by 3.
d)
Divide the number by 3.
28.
A method is a great example of
a)
encapsulation
b)
modulation
c)
abstraction
d)
parameters
29.
______________ of an object can be changed in the properties tab to create “appearing” or “disappearing” effects.
a)
Color
b)
Opacity
c)
Transition
d)
Size
30.
what is a list of steps that you can follow to finish a task?
a)
commands
b)
modules
c)
an algorithm
Reset
