Font size
WorksheetsAP CSP Midterm 2019
Total questions: 89
Worksheet time: 5hrs 1mins
I. If an algorithm runs in reasonable time, the number of steps the algorithm takes is a polynomial function (constant, linear, squared, etc.) of the size of the input.
II. All problems can be solved using an algorithm that runs in reasonable time.
III. If a problem cannot be solved in reasonable time, a heuristic approach is helpful to solve the problem.
Which of the following conditional statements will allow the code to function as expected?
I. temp == 0
II. temp > 0
III. temp < 0
IV. NOT (temp >= 0)
PROCEDURE incrementTemperature(temp)
{
IF (<MISSING CODE>)
{
temp ← temp + 1
}
RETURN temp
}

Trace the value of an integer variableWhat is n?nin the following code.
i ← 1
n ← 2
REPEAT until i = 4
{
n ← n * 2
i ← i + 1
}
a and b, using a temporary integer variable, temp. Will the pseudo-code correctly perform the required task (assume that a and b are never numerically equal)?This is the pseudo-code that the programmer has come up with:
temp ← a # statement 1.
b ← temp # statement 2.
a ← b # statement 3.
1. If lossless compression is applied, every single bit of data that was originally in the file remains after the file is uncompressed.
2. No matter what compression technique is used, once a data file is compressed, it cannot be restored to its original state.
3. The amount of data reduction possible using lossy compression is often much higher than through lossless techniques.
PROCEDURE MoveTriangle (numMoves, numTurns)Which of the following instructions will get the red triangle to the gray square?
{
REPEAT numMoves TIMES
{
MOVE_FORWARD()
}
REPEAT numTurns TIMES
{
TURN_RIGHT()
}
}
MoveTriangle (1, 1) MoveTriangle (1, 1) MoveTriangle (3, 1) MoveTriangle (3, 0)
MoveTriangle (4, 1)
MoveTriangle (4, 0)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 1)
MoveTriangle (3, 0)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 3)
MoveTriangle (3, 0)
Which of the following questions can NOT be answered using only the data and metadata collected?
I - Lossless compression is used only to send files over the Internet
II - Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user.
If the input values are A = 0, B = 0, C = 1, D = 1, what would be the result at output E and G, respectively?
Output E = 0, Output G = 0
Output E = 0, Output G = 1
Output E = 1, Output G = 0
Output E = 1, Output G = 1
If the input values are A = 1, B = 0, C = 1, what would be the result at output D and G, respectively?
Output D = 0, Output G = 0
Output D = 0, Output G = 1
Output D = 1, Output G = 0
Output D = 1, Output G = 1
If the input values are A = 1, B = 0, C = 0, D = 1, what would be the result at output F and G, respectively?
Output F = 0, Output G = 0
Output F = 0, Output G = 1
Output F = 1, Output G = 0
Output F = 1, Output G = 1
If the input values are A = 1, B = 0, C = 1, what would be the result at output E and F, respectively?
Output E = 0, Output F = 0
Output E = 0, Output F = 1
Output E = 1, Output F = 0
Output E = 1, Output F = 1
What is expression that would represent this Boolean Gate Diagram?
(A | B) (+) (C | D)
(A & B) (+) (C | D)
(A | B) | (C & D)
(A & B) (+) (C & D)
What is expression that would represent this Boolean Gate Diagram?
~(A & B) | (C & D)
(A & B) | (C & D)
(A & B) | ~(C & D)
(A & B) | ~(C | D)
What is expression that would represent this Boolean Gate Diagram?
~(A (+) B) & C
(A (+) B) & ~C
(A (+) B) & C
~((A (+) B) & C)
What is expression that would represent this Boolean Gate Diagram?
~(A | B) & C
~((A | B) & C)
~((A | B) & ~C)
(A | B) & C
Which unit is the largest?
Megabyte
Terabyte
Gigabyte
Kilobyte
An artist makes an RGB raster image in which each pixel color is encoded with 12-bits --- 4 bits each for red, green and blue.Which of the following correctly shows the hexadecimal value for Red as a 12-bit representation.
F00
00F
FF00
FF0000
Approximately how much bigger (how many more bytes) is a megabyte than a kilobyte?
1,000 times bigger
100,000 times bigger
1,000,000 times bigger
1,000,000,000 times bigger
Approximately 1,000 ________ are equal to 1 terabyte (1 TB).
jengabytes
gigglebytes
gigabytes
megabytes
Which of the following is a reason to use lossy compression?
You want the compressed file to be larger than the original.
You want the highest quality audio file possible, with no modifications.
You want the highest quality image file possible, with no modifications.
You want to save space and are not concerned if the file is the highest quality possible.
a problem solving approach (algorithm) to find a satisfactory solution where finding an optimal or exact solution is impractical or impossible
Lossless Compression
Heuristic
Lossy Compression
encryption
Which of the following is irreversible?
lossy compression
lossless compression
abstraction
RLI
Which of the file types is an audiofile type?
jpg
mp3
png
csv
An original file is 100 MB, it is compressed to 80 MB (including dictionary). What is its compression rate?
90%
80%
20%
100%
Which of the following hexadecimal representations would represent dark green?
#191399
#00FF10
#001313
#001300
How would you lighten the color #bcc8e1?
+50 to each color component
+50 to the red component
-50 to each color component
-50 to the red component
How many bits are needed to represent 8 colors?
8 bits
24 bits
1 hex digit
3 bits
How many bits are needed to represent a 3 x 3 black and white image (exclude metadata)
3 bits
6 bits
9 bits
9 x 24 bits
The color widget uses 3 bytes of metadata. The first two bytes indicate the width and height of the image. The next byte indicates the number of bits that will be used to represent color. How many bits is used to represent color given the metadata (in binary) 00001000 00001000 0001001
3 bits
6 bits
9 bits
12 bits
Which of the following statements is FALSE?
The computer stores colors in hexadecimal
Every color has 3 components. A red, green and a blue component.
A bright color would be represented by a large number.
A computer uses 3 bytes to store a single colored pixel.
Lil’ Nibble, a local Soundcloud rapper, has recorded a new mixtape called “Half-a-byte,” produced by “Mibikibi and the Teraflops.” The mixtape has several audio files that have been compressed into a .ZIP file so they can be transferred easily and a separate .ZIP file containing album artwork and liner notes. If the mixtape .ZIP file takes up 800 MB and the artwork .ZIP file is 300 MB, what size flash drive do you need in order to transfer the files?
512 MB
1.0 GB
4 KB
2.0 GB
Consider the following three binary numbers:
01010
010000
1110
Which of the following lists the numbers in order from least to greatest?
010000
1110
01010
01010
1110
010000
01010
010000
1110
1110
01010
010000
A new or improved idea, device, product, etc, or the development thereof.
Innovation
Technology
Improvement
Protocol
A way of representing information using only two options.
BInary
Doubled
Algorithm
Hexadecimal
A contraction of "Binary Digit"; the single unit of information in a computer, typically represented as a 0 or 1
Bit
Character
BInar
BiDig
Transmission capacity measure by bit rate
Brandwidth
Latency
Bit Length
Transmission Rate
The number of bits that are conveyed or processed per unit of time. e.g. 8 bits/sec.
Bit Rate
Bit Speed
Latency
BPS
Time it takes for a bit to travel from its sender to its receiver.
Latency
Bit Rate
Bit Speed
BPS
A set of rules governing the exchange or transmission of data between devices.
Protocol
Guideline
Packet
Command
American Standard Code for Information Interchange; the universally recognized raw text
ASCII
USACII
QWERTY
IETF
Instructions for a computer.
Code
Comand
Protocol
Direction
A group of computers and servers that are connected to each other.
Internet
Packets
Online Network
I. logic gates
II. operating systems
III. programming language
IV. machine language
A spinner is divided into three sections. The sector labeled Red is four times as large as each of the sectors labeled Blue and Yellow, which are of equal size. Which of the following correctly simulates the spinner?
Protocol
A set of rules governing the exchange or transmission of data between devices.
A number assigned to any item that is connected to the Internet.
Having multiple backups to ensure reliability during cases of high usage or failure.
A type of computer that forwards data across a network
A raw digital sound file samples a sound wave at some interval and measures the height of the wave at each point. Thus, raw sound is recorded as a list of numbers.
In very broad terms the MP3 audio compression algorithm identifies frequencies and volume levels - low and high - that are outside the range of human hearing and removes the data representing these frequencies from the original. This technique results in a smaller audio file that sounds exactly the same to the human ear.
This technique is an example of what type of compression?
Lossy compression
Lossless compression
Fast Fourier Transform compression
Tailored compression
What is the purpose of a parity bit?
Encryption
Error checking
Issuing a digital certificate
Decryption
1101 0001
What letter of the alphabet would be represented by the following set of numbers representing its RLE compression?
1, 4, 2
1, 1, 3, 1, 1
1, 1, 3, 1, 1
1, 5, 1
1, 1, 4, 1
1, 1, 4, 1
1, 1, 4, 1
1, 5, 1
R
B
C
T
Which of the following code options can be used to move the robot (the black triangle) to the gray square?
REPEAT 2 TIMES:
{
MOVE_FORWARD ()
ROTATE_LEFT ()
MOVE_FORWARD ()
MOVE_FORWARD ()
ROTATE_LEFT ()
}
REPEAT 4 TIMES:
{
ROTATE_LEFT ()
MOVE_FORWARD ()
ROTATE_RIGHT ()
MOVE_FORWARD ()
ROTATE_RIGHT ()
MOVE_FORWARD ()
ROTATE_LEFT ()
}
REPEAT 3 TIMES:
{
MOVE_FORWARD ()
MOVE_FORWARD ()
ROTATE_RIGHT ()
MOVE_FORWARD ()
}
REPEAT 3 TIMES:
{
MOVE_FORWARD ()
MOVE_FORWARD ()
ROTATE_LEFT ()
MOVE_FORWARD ()
}
Bit
A set of rules governing the exchange or transmission of data between devices.
The number of bits that are conveyed or processed per unit of time. e.g. 8 bits/sec.
Time it takes for a bit to travel from its sender to its receiver.
A contraction of "Binary Digit"; the single unit of information in a computer, typically represented as a 0 or 1
