wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP April Review

Total questions: 58

Worksheet time: 1hrs 20mins

Name
Class
Date
1.

The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answeranswer   for four questions on a quiz, what is displayed?

a)

Wrong Wrong Correct Wrong

b)

True True False True

c)

Correct Correct Wrong Correct

d)

Correct Wrong Correct

2.

Consider the following procedures. What is displayed as a result of the procedure call proc2("birthday", "to you") ?

a)

birthday happy to you

b)

birthday happy birthday

c)

to you birthday happy

d)

to you happy birthday

3.

In the procedure Mystery below, the parameter number is a positive integer. Which of the following best describes the result of running the procedure Mystery?

a)

The procedure returns true when the initial value of number is 2, and it otherwise returns false.

b)

The procedure returns true when the initial value of number is greater than 2, and it otherwise returns false.

c)

The procedure returns true when the initial value of number is even, and it otherwise returns false.

d)

The procedure returns true when the initial value of number is odd, and it otherwise returns false.

4.

Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g. 1,2,3...) Which of the following shows a POSSIBLE result of calling the procedure?

a)
b)
c)
d)
5.
a)

The procedure returns nothing because it will not terminate.

b)

The procedure returns the value of 2 * n.

c)

The procedure returns the value of n * n.

d)

The procedure returns the sum of the integers from 1 to n.

6.

Determine what is printed by the following code.

a)

8

b)

-16

c)

-12

d)

16

7.

A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended. Which of the following best describes the result of running the procedure?

a)

The procedure returns TRUE when the user inputs the value "y" and returns FALSE otherwise.

b)

The procedure returns TRUE when the user inputs the value "n" and returns FALSE otherwise.

c)

The procedure returns TRUE no matter what the input is.

d)

The procedure returns FALSE no matter what the input is.

8.

a)
b)
c)
d)
9.

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing toward the top of the grid. Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

a)
b)
c)
d)
10.

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter “G” is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table above.


ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the binary (base 2) number 1010100?

a)

N

b)

P

c)

T

d)

W

11.

Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?

a)

22

b)

37

c)

41

d)

82

12.

What value does the above code segment display?

a)

17

b)

36

c)

53

d)

No value is ever displayed because the algorithm repeats the REPEAT UNTIL block indefinitely.

13.

The above procedure check is called in a program after each time a True or False question is answered. If the user types in True True False True as their answers for four questions on a quiz, what should their overall score be?

a)

25%

b)

50%

c)

75%

d)

100%

14.

ASCII is a character-encoding scheme that uses 7 bits (8 bits if you are using the extended ASCII table) to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table above.


Which ASCII character is represented by the binary (base 2) number 1000001?

a)

A

b)

B

c)

C

d)

D

15.

Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?

Select two answers.

a)

20

b)

30

c)

40

d)

50

16.
What is the purpose of DNS?
a)
It assigns a unique address to every device on the Internet.
b)
It returns the IP address given the name of a website.
c)
It forwards a message from one machine to another.
d)
It has more bits so you can make a longer, unique address.
17.
Why is IP v4 going to be replaced by IP v6?
a)
IP v6 is easier to use.
b)
IP v4 does not work on old hardware.
c)
IP v4 was not encrypted.
d)
We are running out of IP v4 addresses.
18.
Which of the following is considered an unethical use of computer resources?
a)
Downloading freeware or shareware onto your home computer
b)
Purchasing a game from an app store and downloading it directly to a mobile device
c)
Purchasing a single-user copy of photo editing software and installing it on all computers in a computer lab
d)
Searching online for an electronic version of a school textbook
19.
Which of the following statements are true about using a high-level programming language instead of a lower-level language?
 I.  Programs written in a high-level language are generally easier for people to read than programs written in a low-level language.

II.   A high-level language provides programmers with more abstractions than a low-level language.
III.
Programs written in a high-level language are generally easier to debug than programs written in a low-level language.
a)
(A)  I only
b)
(A)  I and III only
c)
(A)  II and III only
d)
(A)  I, II, and III
20.
A user enters a Web address in a browser, and a request for a file is sent to a Web server. Which of the following best describes how the file is sent to the user?
a)
The file is broken into packets for transmission. The packets must be reassembled upon receipt.
b)
The file is broken into packets for transmission. The user’s browser must request each packet in order until all packets are received.
c)
The server attempts to connect directly to the user’s computer. If the connection is successful, the entire file is sent. If the connection is unsuccessful, an error message is sent to the user.
d)
The server repeatedly attempts to connect directly to the user’s computer until a connection is made. Once the connection is made, the entire file is sent.
21.
Two computers are built by different manufacturers. One is running a Web server and the other is running a Web browser. Which of the following best describes the ability of the two computers to communicate with each other across the Internet?
a)
The computers cannot communicate because different manufacturers use different communication protocols.
b)
The computers can communicate, but additional hardware is needed to convert data packets from one computer’s protocol to the other computer’s protocol.
c)
The computers can communicate directly only if the messages consist of text; other formats cannot be interpreted across computers.
d)
The computers can communicate directly because Internet communication uses standard protocols.
22.
Which of the following best describes a Distributed Denial of Service (DDoS) attack?
a)
An attempt by a country to deny its citizens access to the Internet
b)
An attempt to deny users access to a Web site’s resources by flooding the Web site with requests from multiple systems
c)
An attempt by one user to deny service to another user by posting material on a social network
d)
An attempt by a user of the Internet to get private information from a secure database.
23.
A program is expressed in a programming language. Which of the following is true of the program?
a)
The program can also be expressed as binary code, but will be more easily understood by humans when expressed in a higher-level programming language.
b)
The program can also be expressed as binary code, which will reduce the likelihood of errors.
c)
The program cannot be expressed as binary code, because binary code can only be used to represent data.
d)
Some parts of the program can be expressed as binary code, but operations must be expressed using a higher-level programming language.
24.
What is the 4-bit binary number for the decimal number Ten (10)?
a)
0010
b)
1010
c)
0110
d)
0101
25.
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
26.
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
27.
Which of the following best explains what happens when a new device is connected to the Internet?
a)
A device driver is assigned to the device.
b)
An Internet Protocol (IP) address is assigned to the device.
c)
A packet number is assigned to the device.
d)
A Web site is assigned to the device.
28.

Which of the following would pose the greatest threat to a user’s personal privacy if it were to be leaked to the public?

a)

The IP address of the user’s computer

b)

The user’s browser cookies

c)

The user’s email address

d)

The user’s private key used for encryption

29.

Consider the process of encoding and decoding a message using the following Caesar cipher encoding scheme in which the plaintext and ciphertext alphabets are offset by four positions, as shown above.


Which of the following encoded ciphertext strings decodes to an original plaintext message of “secret”?

a)

ersecr

b)

wigvix

c)

kwujwl

d)

oaynap

30.

What is the decimal equivalent of 11010011?

a)

211

b)

210

c)

209

d)

208

31.

What is % in JavaScript?

a)

Square Root

b)

Modulus

c)

Add

d)

Square Root

32.

What is the RGB value of red?

a)

(255,0,0)

b)

(255,0,255)

c)

(255,255,0)

d)

(0,0,255)

33.
Which of the following is a search algorithm which checks each element of a list, in order, until the desired value is found or all elements in the list have been checked?
a)
a) Binary Search
b)
b) Linear Search
c)
c) Iteration
d)
d) Selection
34.
Which of the following is a measure of how many steps are needed to complete an algorithm?
a)
a) Efficiency
b)
b) Selection
c)
c) Sequencing
d)
d) Iteration
35.
Which of the following is a technique that provides a "good enough" solution to a problem when an actual solution is impractical or impossible?
a)
a) Optimization Problem
b)
b) Reasonable Time
c)
c) Heuristic
d)
d) Sequential Computing
36.

Which of the following refers to the runtime of algorithms with exponential or factorial efficiencies?

a)

a) Reasonable Time

b)

b) Heuristic

c)

c) Unreasonable Time

d)

d) Efficiency

37.
Which of the following refers to a model in which programs run by multiple devices?
a)
a) Parallel Computing
b)
b) Sequential Computing
c)
c) Distributed Computing
d)
d) Speedup
38.

Which of the following is a model in which programs are broken into small pieces, some of which are run simultaneously on a single device?

a)

a) Distributed Computing

b)

b) Sequential Computing

c)

c) Parallel Computing

d)

d) Speedup

39.
Which of the following refers to the process of putting steps in order?
a)
a) Sequencing
b)
b) Selection
c)
c) Iteration
d)
d) Optimization Problem
40.
Which of the following is a problem with a yes/no answer?
a)
a) Decision Problem
b)
b) Optimization Problem
c)
c) Undecidable Problem
d)
d) Heuristic
41.
Which of the following refers to a problem with the goal of finding the "best" solution among many?
a)
a) Optimization Problem
b)
b) Decision Problem
c)
c) Undecidable Problem
d)
d) Heuristic
42.
Which of the following refers to a problem for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer?
a)
a) Decision Problem
b)
b) Optimization Problem
c)
c) Undecidable Problem
d)
d) Heuristic
43.

What is an Event?

a)

An action that causes something to happen

b)

An action that doesn’t do anything in the App

c)

An action that will allow you to look up and event

d)

Something that is happening in the calendar

44.
According to the domain name (DNS), which of the following is a subdomain of the domain example.com?
a)
about.example.com
b)
example.co.uk
c)
example.com.org
d)
example.org
45.
Which of the following activities poses the greatest personal cybersecurity risk?
a)
Making a purchase at an online store that uses public key encryption to transmit credit card information
b)
Paying a bill using a secure electronic payment system
c)
Reserving a hotel room by e-mailing a credit card number to a hotel.
d)
Withdrawing money from a bank account using an automated teller machine (ATM)
46.
Which of the following is LEAST likely to indicate a phishing attack?
a)
An e-mail from your bank asks you to call the number on your card to verify a transaction
b)
An e-mail from a merchant asks that you click on a link to reset your password
c)
An e-mail from a utility company asks you to enter your date of birth and social security number for verification purposes.
d)
An e-mail indicates that you have won a large sum of money and asks you to enter your bank account number so that the money can be transferred to you
47.

A flowchart is a way to visually represent an algorithm. The flowchart above uses the building blocks from the table above.


Which of the following statements best describes the behavior of the algorithm depicted in the flowchart?

Assume a always starts greater than b.

a)

It displays the sum of a and b.

b)

It displays the difference between a and b.

c)

It displays the product of a and b

d)

It runs in an infinite loop.

48.

This flowchart is made to ...

a)

Check whether a number is odd or even

b)

Decide if we like a number or not

c)

Calculate the remainder of a number + 2

d)

Help people with Maths

49.
a)

3

b)

6

c)

10

d)

18

e)

It will be different each time you run it

50.
a)

All done.

b)

Inside the If.

c)

Inside the if.

All done.

d)

Inside the else.

All done.

e)

Inside the if.

Inside the else.

All done.

51.
a)

3

b)

6

c)

10

d)

18

e)

It will be different each time you run it

52.
a)

y + z + " and " + x

b)

sentence

c)

BoysHello Girls

d)

Hello Boys and Girls

e)

Hello Girls and Boys

53.
a)

Inside first if

b)

Inside second if

c)

Inside first if

Inside second if

d)

Nothing will be printed

e)

It will be different each time

54.
a)

9

b)

21

c)

81

d)

nothing is printed

e)

this script would cause an error

55.

What is displayed as a result of executing the code segment?

a)

true false false

b)

true false true

c)

true true false

d)

true true true

56.

What is repetition?

a)

Sequence

b)

Selection

c)

Iteration

57.

A diagram that is representation of an algorithm is ....

a)

Flowchart

b)

Pseudocode

c)

System

d)

Component

58.

Which description best describes what this program does?

a)

This program sums up the integers from 8 to 15 (inclusive).

b)

This program sums up the integers from 2 to 8 (inclusive).

c)

This program multiplies the integers from 8 to 15 (inclusive).

d)

This program sums up the integers from 8 to 14 (inclusive).