wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

APCSP Q2 Exam

Total questions: 75

Worksheet time: 2hrs 53mins

Name
Class
Date
1.

Convert 0011 1111 to decimal

a)

32

b)

31

c)

64

d)

63

2.

An Internet attack that causes a server to crash by making repeated requests to the same IP address:

a)

DDoS (Distributed Denial of Service)

b)

Cache Poisoning

c)

DNS (Domain Name System) Hijacking

d)

Phishing

3.
According to the domain name system (DNS), which of the following is a subdomain of the domain code.org?
a)
educate.code.org
b)
code.com
c)
code.org/apcsp/lesson10
d)
code.co.uk
4.
The world is currently in a transition to using IPv6, a newer version of the IP protocol that uses 128-bit addresses instead of 32-bit addresses used by IPv4. What is the main problem that IPv6 was created to solve?
a)
IPv6 will allow problems with IPv4's address hierarchy to be resolved
b)
32-bit addresses could not ensure that every internet-connected device can receive a unique IP address
c)
32-bit addresses could not accommodate the increased size and amount of data traveling on the Internet as it has grown in popularity
d)
IPv4 proved unreliable in some cases where network redundancy could not be ensured
5.
Given the following network diagram, what is the minimum number of connections that must be broken or removed before computer E can no longer communicate with computer B?
a)
1
b)
2
c)
3
d)
4
6.
Which of the following statements about IP addresses is NOT true?
a)
Each IP address has a network previx and may have various subnet and interface IDs
b)
Each of the octets in an address can be any number between 0 and 255
c)
There are no rules or guidelines for creating a new IP address
d)
IP addresses may have prefixes to identify which routers or subnets the address belongs to
7.
Which of the following protocols is primarily used to establish a secure connection between browsers and servers so that no data is lost?
a)
HTTP
b)
SMTP
c)
SSL/TLS
d)
TCP/IP
8.
Andrew uses an application to track HOW LONG it takes a packet to travel from his computer to a Wikipedia server. Which of the following is he measuring?
a)
Bandwidth
b)
Latency
c)
Number of packets
d)
Router sp
9.
Which of the following best describes the basic idea of fault tolerance?
a)
A system that never fails
b)
If part of the system fails, the operation continues without interruption
c)
A program that does not allow inputs out of a range given by a programmer
d)
A program that does not allow loss of precision
10.

The protocol that determines how to address nodes on the network (with IP addresses) and how to route data from one node to a destination node (using routers).

a)

TCP (Transmission Control Protocol)

b)

UDP (User Datagram Protocol)

c)

IP (Internet Protocol)

d)

HTTP (Hypertext Transfer Protocol)

11.
Images can contain a geographical location of where the picture was taken. This is stored in a special area of an image file called:
a)
Metadata
b)
File name.
c)
Compression area.
d)
Alpha-channel.
12.
A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossy transformation of the digital image?
a)
Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black.
b)
Creating a mirrored image by swapping the RGB values from pixels on the left side of an image with RGB values from pixels on the right side of an image.
c)
Swapping the Red and Green values of each pixel so that areas that were red now appear green and vice versa.
d)
Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.
13.
Which of the following statements are true about lossless compression?
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.
a)
I only
b)
II only
c)
I and II
d)
Neither I nor II
14.
A chat Website allows users to post messages to the site. When a user posts a message, the message itself is considered data. In addition to the data, the site stores the following metadata. The time the message was posted and the city from which the message was posted.
Which of the following questions can NOT be answered using only the data and metadata collected?
a)
What topics are most frequently posted about in a particular city?
b)
When is a particular city most active on the site?
c)
Which users post messages most frequently?
d)
What topics are most frequently posted about during a particular time period?
15.
ASCII is a character-encoding scheme that uses 7 bits to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below. What ASCII character is represented by the binary (base 2) number 1010001?
a)
S
b)
R
c)
Q
d)
P
16.
Consider the following numbers Binary 1001001Decimal 70Hexadecimal 4E Which of the following lists the numbers in order from least to greatest?
a)
Binary 1001001, Decimal 70, Hexadecimal 4E
b)
Decimal 70, Binary 1001001, Hexadecimal 4E
c)
Binary 1001001, Hexadecimal 4E, Decimal 70
d)
Decimal 70, Hexadecimal 4E, Binary 1001001
17.
A red triangle is pictured below in a grid of squares. It is currently facing upward, and can only move using the MoveTriangle procedure, shown below. The triangle can move onto white and gray squares, but not onto the black squares.
PROCEDURE MoveTriangle (numMoves, numTurns)
{ 
REPEAT
numMoves TIMES   

MOVE_FORWARD() 
}
 
REPEAT numTurns TIMES 
{   
TURN_RIGHT() 
}
}
Which of the following instructions will get the red triangle to the gray square?
a)
 
MoveTriangle (1, 1) MoveTriangle (1, 1) MoveTriangle (3, 1) MoveTriangle (3, 0)
b)
MoveTriangle (4, 1)
MoveTriangle (4, 0)
c)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 1)
MoveTriangle (3, 0)
 
d)
MoveTriangle (1, 1)
MoveTriangle (1, 3)
MoveTriangle (3, 3)
MoveTriangle (3, 0)
18.
A student purchases a single-user license of an online textbook and wants to share the textbook with their classmates. Under what conditions is it acceptable for the student to share this textbook?
a)
If the student shares only three chapters of the textbook with their classmates
b)
If the textbook is only shared with people in the student’s class
c)
If the textbook is only shared with one other classmate
d)
If the student gets permission from the textbook’s copyright owner
19.
Which of the following statements are true regarding compressing files?
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.
a)
1 and 3
b)
1, 2 and 3
c)
1 and 3
d)
2 and 3
20.
Which of the following statements about abstraction is true?
a)
Abstraction requires users to understand the low-level details of a system.
b)
Abstraction reduces information and detail to facilitate focus on relevant concepts.
c)
Abstraction increases the run-time complexity of a program.
d)
Abstraction compresses a program file to reduce file size.
21.
A programmer is writing code to switch the values of two integer variables, namely 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.
a)
Yes, the code correctly switches the values of 'a' and 'b'.
b)
No, but it will work correctly if statements 1. and 3. are switched.
c)
No, but it will work correctly if statements 2. and 3. are switched.
d)
No, but it will work correctly if statements 1. and 2. are switched.
22.
Trace the value of an integer variable n in the following code.
i ← 1
n ← 2
REPEAT until i = 4
{
  n ← n * 2
  i ← i + 1
}
  What is n?
a)
4
b)
8
c)
16
d)
32
23.
If the number of steps that an algorithm takes is equal to a linear function of the input size, then which of the following statements is true regarding the runtime of the algorithm?
a)
The run-time is directly proportional to the input size.
b)
The run-time is inversely proportional to the input size.
c)
The run-time of the program does not change with respect to the input size.
d)
The run-time first increases and then decreases as the input size is increased.
24.
The Traveling Salesman Problem is a problem in theoretical computer science in which one tries to find the shortest route that passes through every point in a set, once and only once. The optimal solution to the problem for an arbitrary set of of points cannot be found in a reasonable amount of time, that is, it cannot be found in polynomial time. However, we can find an approximation to the optimal solution in a reasonable amount of time. It would be best to find the approximate solution using a
a)
The output of the circuit is always Heuristic algorithm
b)
Brute-Force algorithm
c)
Recursive algorithm
d)
Dynamic algorithm
25.
In a freezer, the temperature can be increased, but should not go above 0° C. It can, however, be exactly equal to 0° C. The unfinished code for increasing the temperature in a freezer is shown below. The variable temp represents the current temperature in degrees Celsius.
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
}
a)
I. and II. only
b)
I. and III. only
c)
I. and IV. only
d)
III. and IV. only
26.
Imagine there is a programming language which uses two different data types to store integers - a 16-bit short data type and a 64-bit long data type. Then which of the following statements is true about the two data types?
a)
The long data type can store 2^48 times as many distinct values as the short data type
b)
The long data type can store 2^64 times as many distinct values as the short data type
c)
The long data type can store 2^16 times as many distinct values as the short data type
d)
The short data type can store 4 times as many distinct values as the long data type
27.
Which of the following statements are true about algorithms?
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.
a)
I, II
b)
I, III
c)
I, II, III
d)
None of the options
28.

What number does 110 represent in binary?

a)

6

b)

3

c)

8

d)

12

29.

What is the minimum number of bits you would need to encode the 26 letters of the alphabet plus a space – a total of 27 characters?

a)

7 BITS

b)

6 BITS

c)

5 BITS

d)

4 BITS

30.

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 m ore 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

31.

A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of goats and sheep throughout the text. Consider the programmer’s goal of changing all occurrences of “goats” to “sheep” and all occurrences of “sheep” to “goats”. The programmer will use the fact that the word “foxes” does not appear anywhere in the original text.

Which of the following algorithms can be used to accomplish the programmer’s goal?

a)

First, change all occurrences of “goats” to “sheep”

Then, change all occurrences of “sheep” to “goats”

b)

First, change all occurrences of “goats” to “sheep”

Then, change all occurrences of “sheep” to “goats”

Last, change all occurrences of “foxes” to “sheep”

c)

First, change all occurrences of “goats” to “foxes”

Then, change all occurrences of “sheep” to “goats”

Last, change all occurrences of “foxes” to “sheep”

d)

First, change all occurrences of “goats” to “foxes”

Then, change all occurrences of “foxes” to “sheep”

Last, change all occurrences of “sheep” to “goats”

32.

Which of the following statements are true about routers and routing on the Internet? (Choose two)

a)

Protocols ensure that a single path between two computers is established before sending packets over it

b)

Routers are hierarchical and the “root” router is responsible for communicating to sub-routers the best paths for them to route internet traffic

c)

A packet traveling between two computers on the Internet may be routed many times along the way or even lost or “dropped”

d)

Routers act independently and route packets as they see fit

33.

From the list provided choose the two (2) answers that correctly describe which Internet protocol relies on the other. For example: if protocol A relies on protocol B, it means that A is a higher level protocol than B, and thus protocol B must exist and work properly in order for protocol A to do its job.

a)

TCP/IP relies on HTTP

b)

HTTP relies on TCP/IP

c)

DNS relies on TCP/IP

d)

TCP/IP relies on DNS

34.

The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom left square of the grid and facing right.

Consider the code segment, which moves the robot in the grid.


Which of the following shows the location of the robot after running the code segment

a)
b)
c)
d)
35.

when a cellular telephone user places a call. The carrier transmits the caller's voice as well as the voice of the person who is called. The encoded voices are the data of the call. In addition to transmitting the data, the carrier also stores metadata. The metadata of the call include information such as the time the call is placed and the phone numbers of both participants. For which of the following goals would it be more useful to computationally analyze the metadata instead of the data?


I. To determine if a caller frequently uses a specific word

II. To estimate the number of phone calls that will be placed next Monday between 10:30 AM and noon.

III To generate a list of criminal suspects when given the telephone number of a known criminal.

a)

I only

b)

II only

c)

II and III only

d)

I, II, and III

36.

Which of the following is least likely to indicate a phishing attack?

a)

An email from your bank asks you to call the number on your card to verify a transaction.

b)

An email from a merchant asks that you click on a link to reset your password.

c)

An email from a utility company asks you to enter your date of birth and social security number for verification purposes.

d)

An email that indicates you have won a large sum of money and asks you to enter your bank account number so that money can be transferred to you.

37.

In public key cryptography, the sender uses the recipient's public key to encrypt a message. Which of the following is needed to decrypt the message?

a)

The sender's public key

b)

The sender's private key

c)

The recipient's public key

d)

The recipient's private key

38.

What are brute-force attacks?

a)

Attacks that use frequency analysis to break passwords

b)

Attacks that check each possible solution to break encrypted data

c)

Attacks against DNS servers to enable DDOS attacks

d)

Attacks on firewalls to gain access to a company's sensitive data

39.

What is a symmetric key used for?

a)

Sending and receiving information from the web

b)

Encrypting data

c)

Decrypting data

d)

Encrypting and decrypting data

40.

What is 20 MOD 15?

a)

0

b)

5

c)

15

d)

20

41.

When a computer scientist uses the term "Big Data" what do they typically mean?

a)

That a dataset is larger than 5TB which is the common "Big Data" threshold.

b)

That there is so much data it's virtually impossible to process.

c)

There is enough data that traditional data processing applications are inadequate.

d)

It implies that the findings from the data are potentially hugely important for society.

42.

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

43.

Which of the following is a reason to use lossy compression?

a)

You want the compressed file to be larger than the original.

b)

You want the highest quality audio file possible, with no modifications.

c)

You want the highest quality image file possible, with no modifications.

d)

You want to save space and are not concerned if the file is the highest quality possible.

44.

How many bits are needed to represent 8 colors?

a)

8 bits

b)

24 bits

c)

1 hex digit

d)

3 bits

45.

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

a)

3 bits

b)

6 bits

c)

9 bits

d)

12 bits

46.

Consider the following three binary numbers:

01010

010000

1110

Which of the following lists the numbers in order from least to greatest?

a)

010000

1110

01010


b)

01010

1110

010000


c)

01010

010000

1110


d)

1110

01010

010000


47.

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

48.

A program contains a 2D array ("CUSTOMER") storing customer numbers, first names and surnames


What data is held in stored in CUSTOMER (2,3)?

a)

Amrit

b)

Kahn

c)

Taylor

d)

1003

49.

Choose 1 answer:

a)

REPEAT 2 TIMES

{

walkForward()

turnRight()

walkForward()

turnRight()

}

b)

REPEAT 2 TIMES

{

walkForward()

turnRight()

walkForward()

turnLeft()

turnLeft()

}

c)

REPEAT 2 TIMES

{

walkForward()

turnRight()

walkForward()

turnLeft()

}

d)

REPEAT 2 TIMES

{

walkForward()

turnLeft()

walkForward()

turnRight()

}

50.

An algorithm will be used to calculate the difference between the smallest and largest values in a list. For the list of [10, 3, 5, 6], it should calculate a difference of 7.


There are two proposals for the algorithm:


Algorithm 1: Set minVal to the first value in the list and maxVal to the last value in the list. Iterate through each number in the list. If the number is greater than maxVal, store it in maxVal. If the number is less than minVal, store it in minVal. After loop, set maxDiff to the difference between maxVal and minVal.


Algorithm 2: Set minVal to 1000 and maxVal to 0. Iterate through each number in the list. If the number is greater than maxVal, store it in maxVal. If the number is less than minVal, store it in minVal. After loop, set maxDiff to the difference between maxVal and minVal.


Which of these statements are true about these algorithms?

I. Algorithm 1 does not work on lists where the smallest value is at the start of the list or the largest value is at the end of the list.

II. Algorithm 2 does not work on lists that contain all negative numbers or all numbers over 1000.

Choose 1 answer:


Choose 1 answer:

a)

I

b)

II

c)

I and II

d)

Neither I or II

51.

"Aba speak" is a game invented by school children to disguise what they're speaking.

When speaking, they transform each word following this algorithm:


For each letter in word:

If letter is vowel:

Add "b" after

Add that letter after "b"


Following that algorithm, how would they transform the word "avocado"?

Choose 1 answer:


Choose 1 answer:

a)

abvobcabdob

b)

avabocabadabo

c)

abavobocabadobo

d)

abavbvobocbcabadbdobo

e)

abavobacabadoba

52.

Determine what is printed by the following code.


values ⬅ [5, 6, 7, 0, 3, 3]

baz ⬅ 0

FOR EACH value IN values

{

if( value ≥ 7 )

{

baz ⬅ baz + 1

}

}

DISPLAY( baz )

a)

1

b)

0

c)

7

d)

6

53.

Determine what is printed by the following code.


list ⬅ [11, 2, 8, 6, 4, 2, 5, 6, 9, 12]

fizz ⬅ 0

thud ⬅ 0

FOR EACH item IN list

{

if( item MOD 3 = 2 )

{

thud ⬅ thud + 1

}

fizz ⬅ fizz + 1

}

DISPLAY( thud / fizz )

a)

0

b)

1

c)

0.5

d)

5/10

54.

A programmer for a weather website needs to display the proportion of days with freezing temperatures in a given month.


Their algorithm will operate on a list of temperatures for each day in the month. It must keep track of how many temperatures are below or equal to 32. Once it's done processing the list, it must display the ratio of freezing days over total days.


Which of these correctly expresses that algorithm in pseudocode?

a)

numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

DISPLAY(numFreezing/numDays)

}

b)

numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

}

DISPLAY(numFreezing/numDays)

c)

numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp < 32) {

numFreezing ← numFreezing + 1

}

numDays ← numDays + 1

}

DISPLAY(numFreezing/numDays)

d)

numFreezing ← 0

numDays ← 0

FOR EACH temp IN temps {

IF (temp ≤ 32) {

numFreezing ← numFreezing + 1

numDays ← numDays + 1

}

}

DISPLAY(numFreezing/numDays)

55.

A programmer is deciding between using a linear or binary search to find a target value in a sorted list. Which of the following is true?

a)

In all cases, a binary search of a sorted list requires fewer comparisons than a linear search.

b)

Generally, the advantage of using a binary search over a linear search increases as the size of the list increases.

c)

A linear search will generally run faster than a binary search because a linear search requires fewer lines of code to implement.

d)

Using a linear search is preferable to using a binary search if there is a chance that the target may not be found in the list.

56.

An algorithm has been developed to compute the sum of all the elements in a list of integers.


Which of the following programming structures must be added to the existing algorithm so that the new algorithm computes the sum of only the even integers in the list?

a)

Iteration

b)

Searching

c)

Selection

d)

Sequencing

57.

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.


Which of the following statements best describes the behavior of the two algorithms?

a)

Both algorithms work correctly on all input values.

b)

Algorithm I always works correctly, but Algorithm II only works correctly when the maximum value is not the first value in the list.

c)

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

d)

Neither algorithm will correctly identify the maximum value when the input contains both positive and negative input values.

58.

Central High School keeps a database of information about each student, including the numeric variables numberOfAbsences and gradePointAverage. The expression below is used to determine whether a student is eligible to receive an academic award.


(numberOfAbsences ≤ 5) AND (gradePointAverage > 3.5)


Which of the following pairs of values indicates that a student is eligible to receive an academic award?

a)

numberOfAbsences = 3, gradePointAverage = 3.5

b)

numberOfAbsences = 5, gradePointAverage = 3.8

c)

numberOfAbsences = 6, gradePointAverage = 3.4

d)

numberOfAbsences = 6, gradePointAverage = 3.6

59.

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)

a)

11

b)

12

c)

23

d)

32

60.

A certain computer game is played between a human player and a computer-controlled player. Every time the computer-controlled player has a turn, the game runs slowly because the computer evaluates all potential moves and selects the best one.


Which of the following best describes the possibility of improving the running speed of the game?

a)

The game’s running speed can only be improved if the game is played between two human players instead of with the computer-controlled player.

b)

The game’s running speed might be improved by using a process that finds approximate solutions every time the computer-controlled player has a turn.

c)

The game’s running speed cannot be improved because computers can only be programmed to find the best possible solution.

d)

The game’s running speed cannot be improved because the game is an example of an algorithm that does not run in a reasonable time

61.

Determine what is printed by the following code.


numbers ⬅ [7, 4, 1, 6, 4, 11, 3]

baz ⬅ 0

FOR EACH value IN numbers

{

if( value < 3 )

{

baz ⬅ baz + 1

}

}

DISPLAY( baz )

a)

0

b)

1

c)

none of the above

62.

Determine what is printed by the following code.


numbers ⬅ [8, 5, 7, 1, 12, 12]

fred ⬅ 0

FOR EACH number IN numbers

{

if( number MOD 2 = 0 )

{

fred ⬅ fred + 1

}

}

DISPLAY( fred )

a)

3

b)

2

c)

1

d)

0

63.

100 dancers are performing in a light show. An algorithm is being used to determine what color light each dancer should have. The color should be blue if and only if the dancer is not on the edge and is in an even row. Which of the following selection statements correctly assigns the blue color?

a)

b)

c)

d)

64.

What will print?

a)

1

2

11

b)

1

2

21

c)

1

2

3

11

d)

1

2

3

21

65.

What value is returned as a result of the call mystry(x)?

a)

x * (x+1)

b)

2x

c)

2(x-1)

d)

x3 +1

66.

What is printed as a result of the call stri("COMPSCI")?

a)

COMPSCI

COMPSC

COMPS

COMP

COM

CO

C

b)

COMPSCI

OMPSCI

MPSCI

PSCI

SCI

CI

I

c)

CO

COM

COMP

COMPS

COMPSC

COMPSCI

d)

C

CO

COM

COMP

COMPS

COMPSC

COMPSCI

67.

What color is 00FF00?

a)

Green

b)

Blue

c)

Red

d)

Yellow

68.

When the function is called, the smaller of two numbers is displayed. What Boolean expression would not work in line 12 in order to accomplish this goal?

a)
b)
c)
d)
69.

What will be the order of letters printed to the console when this program is run?

a)

a b c

b)

a b c b c b c

c)

a b c b c

d)

a b c a

70.

What text will be ouput by the program?

a)

Output A

b)

Output B

c)

Output C

d)

Output D

71.

What text will be ouput by the program?

a)

Less than 10

b)

Less than 20

c)

Less than 30

d)

30 or more

72.

What number will be output by the console.log command on line 5?

a)

10

b)

25

c)

30

d)

35

73.

A museum charges different prices based on the day of the week and age of the visitor. The pricing rules are shown below.

On Tuesday and Thursday children 10 and under get in free ($ 0).

For all other days and ages the cost is ten dollars ($ 10).


The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is stored in the variable price. Which piece of code will correctly decide the price for each ticket.

a)
b)
c)
d)
74.

A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below.

Age | Ticket Price

12 and younger | $5

13 to 64 | $8

65 and older | $6

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.

a)
b)
c)
d)
75.

What will the value of the variable bags be at the end of the flowchart shown here?

a)

1

b)

2

c)

3

d)

4