what is the data type of a number such as 1
Integer
What is the process of making a program run faster through improvement of code?
Optimization
What is the output?
x <- list [1, 3, 6, 30]
y <- x.get(4)
output y
30
What index does an array in the AP CSP language start with?
1
What is the joining of two strings called
Concatenation
What is abstraction
What range of numbers can be produced by this program?
x <- random 3, 300y <- random 50, 51
output random x,y
3, 300
fill the blank
[blank] (x equals 3)
{
code here
}
if
How many bits does a boolean use?
1
What is the time complexity of a linear search?
O(n)
What is the error in this code?
x <- 3
if x => 3
{
output "x is greater than three"
}
else
{
output "x is not greater than three"
}
if should be > not => as it includes 3
(logic error)
What is debugging?
Going through the code and fixing errors in the code
what is the difference between an integer and a float/double
integer can only store whole numbers while floats or doubles are used for decimals
What is the time complexity of a binary search?
O(log(n))
x = true
y = false
output x && (NOT(y || false))
true
Name the three major error types
Syntax (mistype)
Runtime (happens during the running of the code)
Logic (incorrect numbers for example)
How many ints can a integer store?
32
In what scenario is the time complexity of a linear search the same as the time complexity of a binary search? [also put the time complexity)
Best case scenario O(1)
What is the output of this code?
int x = 0
for (1 to 10)
{
for (3 to 8)
{
x = x + 1
}
}
output x
50
What is a library