Spot the Error
Correct the Error
Algorithm Results
Data
Impact of Computing
100

A cash register shows your change as $0.0499999 rather than $0.05. Explain how this is possible.

What is a rounding error due to decimal numbers being stored imprecisely in computers?

100

A student wrote the following program to remove all occurrences of the strings "the" and "a" from the list wordList.

Line 1: index ← LENGTH (wordList)

Line 2: REPEAT UNTIL (index < 1)

Line 3: {

Line 4:    IF ((wordList[index] = "the") OR (wordList[index] = "a"))

Line 5:    {

Line 6:       REMOVE (wordList, index)

Line 7:    }

Line 8: }

While debugging the program, the student realizes that the loop never terminates. State the change that can be made so that the program works as intended

What is inserting index ← index - 1 between lines 7 and 8 ?

100

Consider the following code segment, which uses the variables r, s, and t.

r ← 1

s ← 2

t ← 3

r ← s

s ← t

DISPLAY (r)

DISPLAY (s)

State the result of running the code segment.

What is 2 3, where r=2, s=3?

100

A digital photo file contains data representing the level of red, green, and blue for each pixel in the photo. The file also contains metadata that describes the date and geographic location where the photo was taken. State when analyzing the metadata would be more appropriate than analyzing the data

What is determining the likelihood that the photo was taken at a particular public event?

100

An experiment that requires data measurements to be taken in many different locations.

What is Citizen Science?

200

In a certain computer program, two positive integers are added together, resulting in an overflow error. Explain why the error occurs.


What is the program can only use a fixed number of bits to represent integers; the computed sum is greater than the maximum representable value?

200

Assume that the list of numbers nums has more than 10 elements. The program below is intended to compute and display the sum of the first 10 elements of nums.

Line 1: i ← 1

Line 2: sum ← 0

Line 3: REPEAT UNTIL (i > 10)

Line 4: {

Line 5:    i ← i + 1

Line 6:    sum ← sum + nums[i]

Line 7: }

Line 8: DISPLAY (sum)

State the change that needs to be made for this procedure to work as intended.

What is Lines 5 and 6 should be interchanged?

200

Consider the code segment below.

The variables onTime and absent both have the value false, say what is displayed as a result of running the code segment.

What is "Better late than never."?

200

A file storage application allows users to save their files on cloud servers. A group of researchers gathered user data for the first eight years of the application’s existence. Some of the data are summarized in the following graphs. The line graph on the left shows the number of registered users each year. The line graph on the right shows the total amount of data stored by all users each year. The circle graph shows the distribution of file sizes currently stored by all users.

 

Describe the average amount of data stored per user for the first eight years of the application’s existence.

What is Across all eight years, the average amount of data stored per user was about 10 GB?

200

Name a challenge involved in using a parallel computing solution.

What is a parallel computing solution may not be appropriate for an algorithm in which each step requires the output from the preceding step?

300

A video-streaming Web site keeps count of the number of times each video has been played since it was first added to the site. The count is updated each time a video is played and is displayed next to each video to show its popularity.

At one time, the count for the most popular video was about two million. Sometime later, the same video displayed a seven-digit negative number as its count, while the counts for the other videos displayed correctly. Identify the error that is occuring.

What is an OVERFLOW ERROR: The count for the video became larger than the maximum value allowed by the data type used to store the count?

300

The following procedure is intended to return the number of times the value val appears in the list myList. The procedure does not work as intended.

Line 01: PROCEDURE countNumOccurences(myList, val)

Line 02: {

Line 03:    FOR EACH item IN myList

Line 04:    {

Line 05:          count ← 0

Line 06:          IF(item = val)

Line 07:          {

Line 08:               count ← count + 1

Line 09:          }

Line 10:   }

Line 11:   RETURN(count)

Line 12: }


State the change that needs to be made so that the procedure will work as intended.

What is moving the statement in line 5 so that it appears between lines 2 and 3 ?

300

he diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output.

If the inputs A and C are both true, describe the output of the AND gate.

What is the output will be true no matter what the value of input B is?

300

An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Describe the result of using 7-bit sequences instead of 6-bit sequences.

What is 2 times as many items can be uniquely identified?

300

A small team of wildlife researchers is working on a project that uses motion-activated field cameras to capture images of animals at study sites. The team is considering using a “citizen science” approach to analyze the images. Explain why such an approach is considered useful for this project.

What is the image analysis is likely to take a longer time for the research team than for a distributed group of individuals?

400

A program is created to perform arithmetic operations on positive and negative integers. The program contains the following incorrect procedure, which is intended to return the product of the integers  and .

A programmer suspects that an error in the program is caused by this procedure. State 2 conditions where the procedure NOT return the correct product


What is

1. When the values of  is positive and the value of  is negative. 

2. When the values of  and  are both negative. 

?

400

The code fragment below is intended to display "odd" if the positive number num is odd.

State the code that can be used to replace <MISSING CONDITION> so that the code fragment will work as intended.

What is (num MOD 2) = 1 ?

400

Consider the following code segment, where exam and presentation are integer variables and grade is a string variable.

IF((exam > 90) AND (presentation > 80))

{

grade ← "A"

}

IF((exam > 80) OR (presentation > 75))

{

grade ← "B"

}

ELSE

{

IF((exam > 70) OR (presentation > 60))

{

grade ← "C"

}

ELSE

{

IF(exam > 60)

{

grade ← "D"

}

ELSE

{

grade ← "F"

}

}

}

Describe the conditions that will cause the value "C" to be assigned to the variable grade.

What is when the value of exam is 80 and the value of presentation is 60?

400

A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. State how the eight directions must be stored in memory.

What is Four bits are enough to store the eight directions?

400

Describe how cloud computing has affected Internet communication

What is Cloud computing has helped enhance collaboration and Cloud computing has introduced new data-security concerns?

500

The program below is intended to count the number of prime numbers in a list called  and display the result. The program uses the procedure , which returns  if  is a prime number and  otherwise.

The program does not work as intended.

State the two lines of code that should be removed 

What is Line 4 and Line 9?

500

In a science experiment, result X is expected to occur 25% of the time and result Y is expected to occur the remaining 75% of the time. The following code segment is intended to simulate the experiment if there are 100 trials.

Line 1:  xCount ← 0

Line 2:  yCount ← 0

Line 3:  REPEAT 100 TIMES

Line 4:  {

Line 5:     IF(RANDOM(1, 4) = 1)

Line 6:     {

Line 7:        xCount ← xCount + 1

Line 8:     }

Line 9:     IF(RANDOM(1, 4) > 1)

Line 10:    {

Line 11:       yCount ← yCount + 1

Line 12:    }

Line 13: }

Line 14: DISPLAY("Result X occurred")

Line 15: DISPLAY(xCount)

Line 16: DISPLAY("times and result Y occurred")

Line 17: DISPLAY(yCount)

Line 18: DISPLAY("times.")

A programmer runs the code segment, and the following message is displayed.

Result X occurred 24 times and result Y occurred 70 times.

The result shows that 94 trials were counted, rather than the intended 100 trials.


State the change that is needed to ensure the simulation runs as intended.

What is Replacing line 9 with ELSE?

500

An algorithm will be used to identify the maximum value in a list of one or more integers. Consider the two versions of the algorithm below.

Algorithm I : Set the value of a variable max to − 1. Iterate through the list of integer values. If a data value is greater than the value of the variable max, set max to the data value.

Algorithm II : Set the value of a variable max to the first data value. Iterate through the remaining values in the list of integers. If a data value is greater than the value of the variable max, set max to the data value.

Describe the behavior of the two algorithms.

What is Algorithm II always works correctly, but Algorithm I only works correctly when the maximum value is greater than or equal to − 1?

500

Each student at a school has a unique student ID number. A teacher has the following spreadsheets available.

  • Spreadsheet I contains information on all students at the school. For each entry in this spreadsheet, the student name, the student ID, and the student’s grade point average are included.
  • Spreadsheet II contains information on only students who play at least one sport. For each entry in this spreadsheet, the student ID and the names of the sports the student plays are included.
  • Spreadsheet III contains information on only students whose grade point average is greater than 3.5. For each entry in this spreadsheet, the student name and the student ID are included.
  • Spreadsheet IV contains information on only students who play more than one sport. For each entry in this spreadsheet, the student name and the student ID are included.

The teacher wants to determine whether students who play a sport are more or less likely to have higher grade point averages than students who do not play any sports. State which spreadsheets can be combined and analyzed to determine the desired information.

What is Spreadsheets I and II?

500

Which of the following are true statements about how the Internet enables crowdsourcing?

I. The Internet can provide crowdsourcing participants access to useful tools, information, and professional knowledge.

II. The speed and reach of the Internet can lower geographic barriers, allowing individuals from different locations to contribute to projects.

III. Using the Internet to distribute solutions across many users allows all computational problems to be solved in reasonable time, even for very large input sizes.

What is I and II only ?

M
e
n
u