Digital Information 1
Digital Information 2
Programming 1
Programming 2
Programming 3
100

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

 A.   When the problem can be solved in a reasonable time and an approximate solution is acceptable

 B.   When the problem can be solved in a reasonable time and an exact solution is needed

C.   When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

 D.   When the problem cannot be solved in a reasonable time and an exact solution is needed 

C.   When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

100

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-bitrepresentation.

 A.   F00

 B.   00F

 C.   FF00

 D.   FF0000 

A.   F00 

The correct answer is F00. A single hex digit is used to represent a 4-bit sequence - since there are 16 possible 4-bit sequences and 16 different hex digits 0-F.

So 3 hex digits represents 12 bits, and the first digit represents the intensity of Red in an RGB image.

100

Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages:

 A.   Ambiguities in natural language necessitate the creation of programming languages for controlling a computer

 B.   Compared to the number of words in a natural language, the number of defined words in a programming language is very small.

 C.   The number of defined words in a programming language is about the same as the number of words in a natural language.

 D.   There are typically many possible ways to interpret an instruction written in a programming language. 

 A.   Ambiguities in natural language necessitate the creation of programming languages for controlling a computer

 B.   Compared to the number of words in a natural language, the number of defined words in a programming language is very small. 

100

Consider the following flow chart showing a process for program execution. Given that a = 5, and b = 10, what will be displayed by the program?

 A.   a is bigger

 B.   b

 C.   5

 D.   10

 E.   Nothing will be displayed 

D.   10

  

100

What is the output of the following JavaScript code segment?


 A.   10

 B.   error on str1 + str2: type mismatch

 C.   55

 D.   result 

C.   55

  

200

The colors of the pixels in a digital image are often represented by red, green, and blue values between 0 and 255 (an RGB triplet). A photographer is manipulating a digital image to lighten it because all of the RGB values in the image are less than 100, making it very dark. He does this by adding 20 to the R, G, and B values of each pixel, then overwriting the original image. What type of transformation is the photographer using on the digital image?

 A.   Lossless transformation

 B.   Lossy transformation

 C.   Multiband transformation

 D.   Chrome Sampling transformation 

A.   Lossless transformation

200

A compression scheme for long strings of bits called run-length encoding is described as follows:

Rather than record each 0 and 1 individually, instead record "runs" of bits by storing the number of consecutive 1s and 0s that appear.

Since it's binary, any run of 0s must be followed by a run of 1s (even if the run is only 1-bit long) and vice versa. Thus, you can store a list of small numbers that represents the alternating runs of 0s and 1s. Here is an example:

To uncompress the data back into its original binary state, you simply reverse the process. This technique is an example of what type of compression?


 A.   Lossy compression

 B.   Lossless compression

 C.   Fast Fourier Transform compression

 D.   Tailored compression 

B.   Lossless compression

  

200

Which of the following images shows the path and ending location of the robot that will result from executing the code above. The starting location of the robot is shown as dotted triangle for cases where the robot does not start and end at the same location.

 A.     B.     C.     D.     E.  

 B.  

200

What is a possible output when the following code segment executes? The ending position of the turtle is shown in each diagram. The starting position is shown as a white triangle in cases where the turtle starts and ends in different locations.

 A.    

 B.    

 C.    

 D.    

 E.     

C.  

  

200

A Boolean expression is an expression that evaluates to which of the of the following?

 A.   Yes/Maybe/No

 B.   True/False

 C.   Any Integer

 D.   Integers between 1 and 10

 E.   Any single character 


B.  True/False 

300

Which of the following is a true statement about data compression?

 A.   Data compression is only useful for files being transmitted over the Internet.

 B.   Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state.

 C.   Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user.

 D.   There are trade-offs involved in choosing a compression technique for storing and transmitting data. 

D.  There are trade-offs involved in choosing a compression technique for storing and transmitting data. 

300

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?

 A.   Lossy compression

 B.   Lossless compression

 C.   Fast Fourier Transform compression

 D.   Tailored compression 

A.   Lossy compression

300

Consider the following incorrect program, which is intended to move the robot around the perimeter of a grid, as indicated by the drawing below. The starting position and direction of the robot is indicated in the diagram. 


  • Fig: What the robot is supposed to do

Given the options below, which lines should be removed so the program will work as intended?

 A.   Line 3 and Line 4

 B.   Lines 5, 6, 7, 8 and 9

 C.   Line 8 and Line 9

 D.   Line 9 

A.   Line 3 and Line 4

300

Which of the following statements about strings in JavaScript is FALSE?

 A.   Strings consist of a sequence of concatenated characters.

 B.   Strings are indicated by quotation marks.

 C.   Strings with numerical digits in them are invalid.

 D.   A string can be empty, meaning that it contains nothing.

 E.   Strings sometimes include spaces. 

C.   Strings with numerical digits in them are invalid.

  

300

Consider the following segment given in pseudo code (see reference from previous question):


What will be displayed if grade is set to 70?

 A.   You passed!

 B.   Time to start studying again!

 C.   You passed! and Time to start studying again!  

 D.   Nothing will be displayed

 E.   An error will occur on line 7; you cannot have an IF inside an ELSE statement 

A.   You passed!

  

400

A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers?

 A.   2 times as many values can be represented.

 B.   32 times as many values can be represented.

C.   2^32 times as many values can be represented.

 D.   32^2 times as many values can be represented. 

C.   2^32 times as many values can be represented.

Every time you add a single bit to a binary number, you multiply by 2 the number of numbers you can represent. So for example, a 2-bit number can represent 4 numbers (0 - 3), and a 3-bit number can represent 8 numbers (0 - 7). So if you're going from a 32-bit to a 64-bit number, you are multiplying the number of numbers you can represent by 2, 32 times, so 2^32 is the correct answer.

400

Approximately how much bigger (how many more bytes) is a megabyte than a kilobyte?

 A.   1,000 times bigger

 B.   100,000 times bigger

 C.   1,000,000 times bigger

 D.   1,000,000,000 times bigger 

A.   1,000 times bigger

400

Which of the following is NOT true about functions in programming?

 A.   Functions are reusable programming abstractions.

 B.   Functions help reduce the complexity of writing and maintaining programs.

 C.   Functions cannot make calls to other functions within the same program.

 D.   Functions help break a problem into logical chunks.

 E.   Once defined, a function can be called many times from different parts of a program. 

C.   Functions cannot make calls to other functions within the same program.

400

Which of the following JavaScript statements will result in the following output being displayed to the console?


 A.   console.log("Hello! \tHow are you?");

 B.   console.log("Hello! \bHow are you?");

 C.   console.log("Hello! \newLineHow are you?");

 D.   console.log("Hello! \nHow are you?");

 E.   console.log("Hello! \nlHow are you?"); 

 D.   console.log("Hello! \nHow are you?");

  

400

Consider the JavaScript code segment below. Which statement should be used in place of <missing code> such that the alarm is set to 9:00 am on weekends, and 6:30 am on weekdays.

 

 A.   day == "Saturday"

 B.   day == "Sunday"

 C.   (day == "Saturday") || (day == "Sunday")

 D.   (day == "Saturday") && (day == "Sunday")

 E.   day != "Monday" 

C.   (day == "Saturday") || (day == "Sunday")

  

500

Select the answer that lists the units of bytes in ascending order (from smallest to largest)

 A.   gigabyte, megabyte, terabyte

 B.   megabyte, terabyte, kilobyte

 C.   gigabyte, terabyte, megabyte

 D.   kilobyte, gigabyte, terabyte 

D.   kilobyte, gigabyte, terabyte

  

500

The image below shows an encoding for a black and white pixel image. The first two bytes of the data (circled in red) are used to encode the width and height of the image.

What is the best term for this type of "data about the data"?


 A.   megadata

 B.   superdata

 C.   metadata

 D.   predata 

C.   metadata

500

Which of the following will call the function drawStar?

 A.    

 B.    

 C.    

 D.    

 E.     

B

500

What is the output of the following JavaScript code segment?


 A.   5hello

 B.   5 + hello

 C.   error on num + str: type mismatch

 D.   result 

A.   5hello

  

500

Consider the following JavaScript code segment.


Something is wrong with the logic in the program above. For which values of time will the greeting “Good Morning!” be displayed?

 A.   Any time between 6 and 9

 B.   Any time between 10 and 19

 C.   Any time between 0 and 20

 D.   There is no value of time that will result in “Good Morning!” being displayed

 E.   The logic error will cause the program to stop running at line 7. 

D.   There is no value of time that will result in “Good Morning!” being displayed

  

M
e
n
u