Font size
WorksheetsAP CSP 200PT Quizizz 1-29
Total questions: 74
Worksheet time: 50mins
What is the difference between loops and conditionals?
(a)
"If there is a bee"
The statement above is a loop.
True
False
The purple code is
conditional
loop
The picture represents conditionals
True
False
"If path is to the right"
The statement above is an example of a conditional.
True
False
"Repeat until" is an example of a loop
True
False
What is a loop?
(a)
You can repeat conditionals by placing the conditionals inside of repeat.
True
False
The picture shows an example of
conditionals
loops
The picture shows
Conditionals
loops
Which word means the same as "repeat".
Iterate
program
loop
for loop
Is used to repeat a specific block of code an unknown number of times, until a condition is met.
Iteration
Infinite Loop
For Loop
While Loop
Is used to repeat a specific block of code a known number of times.
Iteration
Infinite Loop
For Loop
While Loop
Read each scenario. In which would a loop be most helpful?
Maura wants a program to perform a math operation one time.
Jamila is programming a robot to hop once and then raise its arm once.
Vinny wants a program to go through a list of 35 of his friends and remind each friend what time a study group starts.
Damian is writing a program that will tell him what to wear depending on the weather.
adds one to variable x in a loop
increment (x)
x++;
x=x;
y+1;
How many times will the following program print "hello"?
10
11
9
This code will loop infinitely
What is wrong with this loop?
Nothing, it works
moveForward is not a command
The value of the variable is 0
It never ends
We want to simulate constantly flipping a coin until we get 3 heads in a row. What kind of loop should we use?
For loop
While loop
Loop and a half
Infinite loop
OUTPUT?
var i = 1;
while (i < 5) {
System.out.println("Hello");
i++;
}
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
What is the final sum after this loop executes
sum = 5
sum = 10
sum = 15
What are the values of count1 and count2 as a result of executing the code segment?
count1 = 2, count2 = 2
count1 = 2, count2 = 3
count1 = 3, count2 = 2
count1 = 5, count2 = 0
What will be displayed in the console when the following program runs?
0 2 4 6
0 2 4
2 4 6
The program will result in an infinite loop
What number will be output by the console.log command on line 7?
50
100
200
300
Conditional Statement
affects the sequence of statements followed in a program by executing different statements based on the value of a Boolean expression
is a statement that always executes regardless of conditions
is used to declare variables in a program
is a type of loop that repeats a block of code
What will the value of the variable bags be at the end of the flowchart shown here?
2
3
4
5
A concert hall charges different ticket prices based on the customer's age. The prices are shown in the table below.
Age Ticket Price
12 and younger $10
13 to 64 $15
65 and older $5
The customer's age is stored in the variable age and the price is stored in the variable price. Which piece of code will correctly decide the price for each ticket?
if (age <= 12) price = 10; else if (age >= 13 && age <= 64) price = 15; else price = 5;
if (age < 12) price = 10; else if (age < 65) price = 15; else price = 5;
if (age <= 12) price = 15; else if (age <= 64) price = 10; else price = 5;
if (age < 13) price = 5; else if (age < 65) price = 10; else price = 15;
What will the value of the variable bags be at the end of the flowchart shown here?
1
2
3
4
What number will be output by the console.log command on line 5?
40
41
42
43
What will the value of the variable bags be at the end of the flowchart shown here?
1
2
3
4
What will the value of the variable bags be at the end of the flowchart shown here?
0
1
2
3
What text will be output by the program? Options: Be super careful, Think about it, Hey calm down, Do what you want
Be super careful
Think about it
Hey calm down
Do what you want
What text will be output by the program? Options: Be super careful, Think about it, Hey calm down, Do what you want
Be super careful
Think about it
Hey calm down
Do what you want
What text will be output by the program? Options: A, B, C, D, E
A
B
C
D
What text will be output by the program? Options: Be super careful, Think about it, Hey calm down, Do what you want
Be super careful
Think about it
Hey calm down
Do what you want
What will be the order of numbers printed to the console when this program is run? Options: 123, 123123, 12323, 1231321
123
123123
12323
1231321
What line is responsible for the error in the statement "You are a cat@#@$!!!" never displays?
1
2
3
4
What text will be output by the program? A, B, C, D, E
A
B
C
D
What number will be output by the console.log command on line 7? Options: 50, 100, 200, 300
50
100
200
300
What number will be output by the console.log command on line 5? Options: 10, 15, 20, 25
10
15
20
25
What will the “background-color” of the “bottomButton” be when the program is finished running?
If the user DOES click the button what color will “topButton” be when this program finishes running?
The following program is run. The user DOES NOT click the "topButton" button. What will be displayed in the console?
cat dog
dog cat
The following program is run. Then the user clicks the “bottomButton” TWICE and DOES NOT click the “topButton”. What will be displayed in the console?
chicken cow cow
chicken pig pig
bow chicka wow wow
What is the User Interface
Elements of which the user controls
Elements of which the coder controls
An interface with code
An interface with options
An error in a program that prevents the program from running as expected
onEvent
Bug
Moth
Fly in the Ointment
Which of the following best describes how computing devices represent information?
A computer will either represent information as bits or bytes but not both
A computer represents data as a byte which is either a 0 or a 1
A computer represents data as bits which is either a 0 or a 1
A computer represents information as bits which contain 8 bytes.
Which of the following is NOT true of how computers represent complex information?
Computing devices use patterns of bits to represent complex information
Abstraction helps represent complex information by surfacing complexity that might otherwise be hidden
Depending on context the same sequence of bits may represent different types of information
Common abstractions that are represented by computing devices include numbers, characters, and color.
When visiting a museum Lian takes a photo of a painting with a smartphone which stores the photo as an image file. Which of the following best describes the differences between the painting itself and the photo of the painting stored on the smartphone?
Both the painting and the photo are analog
The photo is a digital representation of the analog painting
Sampling can be used to determine whether the analog image is an accurate representation of the painting
The phone can represent the photo in either digital or analog formats depending on the sampling technique that is used
Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number for which an overflow error occur?
14
15
16
17
Which of the following is true of how computers represent numbers?
Using a fixed but large number of bits can eliminate the possibility of round off error when representing numbers in binary
With a fixed number of bits some numbers are too large to represent in a computer which will lead to overflow errors.
Using a fixed but large number of bits, for example 128, eliminates the possibility of overflow errors.
With a large but fixed number of bits it is possible to eliminate either round-off errors or overflow errors, but not both.
Convert the binary (base-2) number 1001 to decimal (base-10).
9
10
16
17
Convert the decimal (base-10) number 20 to binary (base-2).
10010
00101
11000
10100
Which of the following binary (base-2) numbers is LARGEST?
11000000
01111111
00000001
10111111
How many total numbers can be represented with an 8-bit binary (base-2) system?
127
128
255
256
Which of the following is true of lossy and lossless compression algorithms?
Lossy compression algorithms are used when perfect reconstruction of the original data is important.
Lossy compression algorithms are typically better than lossless compression algorithms at reducing the number of bits needed to represent a piece of data.
Lossless compression algorithms are only used to compress text data.
Lossless compression algorithms only allow for an approximate reconstruction of the original data.
Jorge is sending a large image file to a friend as part of a shared classroom project. Which of the following is most likely true if Jorge opts to compress the image before sending it?
The image can no longer be represented using bits.
The image will have been converted into an analog form.
The image will require more pixels to display it on the screen.
The image will require fewer bits in order to be represented.
Which of the following is true of intellectual property?
Information created on a computer is not owned by anyone since only analog information is protected under copyright law.
You do not need to cite work created by someone else if both the original work and your use of it are in digital form.
Creative Commons enables content creators to freely distribute their otherwise copyrighted work.
Creative Commons has severely hindered broad and open access to digital information
Lucy is completing a project as part of a science class using materials she found online. Which of the following is MOST LIKELY to lead to legal consequences?
Modifying a piece of open source software.
Using open access research for which she does not acquire a license.
Failing to publish her work under a Creative Commons license.
Using images posted online by another student without permission or citation.
Ryan is designing an app that needs to quickly send low quality photos between users. Most smartphones take much higher quality photos than Ryan needs for his app. Which answer best describes the type of compression Ryan should choose and why?
Lossless compression since it ensures perfect reconstruction of the photo.
Lossy compression since it ensures perfect reconstruction of the photo.
Lossless compression since it typically results in smaller data sizes.
Lossy compression since it typically results in smaller data sizes.
Arman takes a picture with his smartphone which he subsequently posts online. Beatrice finds the picture online and posts a copy of it on her website with an attached Creative Commons license. Which of the following best describes who owns the photo?
Beatrice owns the photo because only holders of a Creative Commons license can own works online.
Arman owns the photo because he was the original creator and did not license the work.
Arman owns the photo because it was granted a Creative Commons license by another person online.
Both own the photo because creating a copy makes it her intellectual property.
