wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

APCS Principles Practice Exam

Total questions: 75

Worksheet time: 42mins

Name
Class
Date
1.

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

4 <- 1

s <- 2

t <- 3

r <- s

s <- t

DISPLAY(r)

DISPLAY(s)

What is displays as a result of running the code segment?

a)

1 1

b)

1 2

c)

2 3

d)

3 2

2.

Which of the following is a true statement about program documentation?

a)

Program documentation should not be changed after it is first written

b)

Program documentation is only needed for programs in development; it is not needed after a program is completed

c)

Program documentation is useful when programmers collaborate but not when a programmer works individually on a project

d)

Program documentation is useful during initial program development and also when modifications are made to existing programs

3.

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

4.

Consider the code segment.

Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?

a)

j = 6

b)

j 6

c)

j = 7

d)

j > 7

5.

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation resulted in an equal number of heads and tails

Step 1: Initialize the heads_counter and flip_counter to 0

Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1.

Step 3: Increment the value of flip_counter by 1.

Step 4: Repeat step 2 and 3 until flip_counter equals 4

Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

a)

coin_flip = 1

b)

flip_counter = 1

c)

flip_counter = 2

d)

heads_counter = 2

6.

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

7.

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

8.

The code segment uses the procedure IsFound(list, item), which returns true if item appears in list and returns false otherwise. The list resultList is initially empty

Which of the following best describes the contents of resultList after the code segment is executed?

a)

All elements in inputList1 followed by all elements in inputList2

b)

Only elements that appear in both inputList1 and inputList2

c)

Only elements that appear in either inputList1 or inputList2 but not in both lists

d)

Only elements that appear in inputList1 but not in inputLists2

9.

A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considerations is Least likely to affect the ability of the program to process larger data sets?

a)

How long the program takes to run

b)

How many programming statements the program contains

c)

How much memory the program requires as it runs

10.

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

11.

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 the computers in an computer lab

d)

Searching online for an electronic version of a school textbook

12.

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 abstraction 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)

I only

b)

I and III only

c)

II and III only

d)

I, II, and III

13.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality?

a)

The song was saved using fewer bits per second than the original song

b)

The song was saved using more bits per second than the original song

c)

The song was saved using a lossless compression technique

d)

Some information is lost every time a file is saved from one location on a computer to another location

14.

Consider the program, which is intended to display the number of times a number target appears in a list.

Which of the following best describes the behavior of the program?

a)

The program correctly displays the number of times target appears in the list

b)

The program does not work as intended when target does not appear in the list

c)

The program does not work as intended when target appears in the list more than once

d)

The program does not work as intended when target appears as the last element of the list

15.

In the program below, the initial value of x is 5 and the initial value of y is 10

What is displayed as a result of running the program

a)

Foxtrot

b)

Hotel

c)

November

d)

Yankee

16.

The procedure Draw (length, direction) is used to draw a line segment length units long in a given direction (left, right, up, or down), starting at the current cursor position. The cursor is then repositioned at the end of the line segment that was drawn. Consider the following program, where the cursor starts in the upper left corner of a grid of dots. The dots are spaces one unit apart.

Draw (1,right)

Draw (2, down)

Draw (1, left)

Draw (1, right)

Draw (1, up)

Draw (1, left)

Which of the following represents the figure that is drawn by the program?

a)
b)
c)
d)
17.

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

18.

Computers are often used to search through large sets of data to find useful patterns in the data. Which of the following tasks is NOT an example where searching for patterns is needed to produce useful information?

a)

A credit card company analyzing credit card purchases to identify potential fraudlent charges

b)

A grocery stor analyzing customers' past purchases to suggest new products the customer may be interested in

c)

A high school analyzing student grades to identify the students with the top ten highest grade point averages

d)

An online retailer analyzing customers' viewing habits to suggest other products based on the purchasing history of other customers

19.

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

IF<MISSING CONDITION>

DISPLAY"ODD"

Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended?

a)

(num MOD 1) = 0

b)

(num MOD 1) = 1

c)

(num MOD 2) = 0

d)

(num MOD 2) = 1

20.

What is the minimum number of connections that must be broken or emoved in the network before computer E can no longer communicate with computer F?

a)

1

b)

2

c)

3

d)

4

21.

Which of the following statements about security in the network is true?

I. Computers A and D need to communicate with at least two additional computers in the network in order to communicate with each other.

II. Computers B and C can communicate with each other without additional computers being aware of the communication.

a)

I only

b)

II only

c)

I and II

d)

Neither I nor II

22.

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.

What ASCII character is represented by the binary number 1001010?

a)

H

b)

I

c)

J

d)

K

23.

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.

24.

Some programming languages use constants, which are variables that are initialized at the beginning of a program and never changed. Which of the following are good uses for a constant?

I. To represent the mathematical value π (pi) as 3.14

II. To represent the current score in a game

III. To represent a known value such as the number of days in a week

a)

I and II only

b)

 I and III only

c)

II and III only

d)

 I, II, and III

25.

A cable television company stores information about movie purchases made by subscribers. Each day, the following information is summarized and stored in a publicly available database.

• The day and date each movie was purchased

• The title of each movie purchased

• The cities where subscribers purchased each movie

• The number of times each movie was purchased by subscribers in a given city

A sample portion of the database is shown in the table. The database is sorted by date and movie title.

Which of the following CANNOT be determined using only the information in the database?

a)

The date when a certain movie was purchased the greatest number of times

b)

The number of movies purchased by an individual subscriber for a particular month

c)

The total number of cities in which a certain movie was purchased

d)

The total number of movies purchased in a certain city during a particular month

26.

The question below 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 toward the top of the grid.

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, …).

PROCEDURE Mystery p

Repeat p times{

MOVE_FORWARD

MOVE_FORWARD

ROTATE_RIGHT

}

a)
b)
c)
d)
27.

A new bank plans to make customer convenience a priority by minimizing the amount of time a customer waits in line. The bank is considering two options: a single line where the customer at the front waits for the next available teller, or separate lines for each teller. The bank decides to use a computer simulation of these two options to determine the average wait time for customers.

Which of the following is NOT true about the bank’s plan?

a)

The bank can incorporate other factors, such as the number of tellers, in the simulation.

b)

The bank can use the simulation to investigate these two options without causing inconvenience for customers.

c)

The bank may consider new alternatives based on the simulation results.

d)

The simulation will not produce usable results because actual customer data are not available.

28.

  Consider the code segment.

Which of the following changes will NOT affect the results when the code segment is executed?

a)

Changing line 3 to

b ← 10

b)

Changing line 3 to

a ← b+10

c)

Changing line 7 to

b ← 20

d)

Changing line 7 to

a ← b + 20

29.

A programmer wrote the program below. The program uses a list of numbers called numList. The program is intended to display the sum of the numbers in the list.

In order to test the program, the programmer initializes numList to [0, 1, 4, 5]. The program displays 10, and the programmer concludes that the program works as intended. Which of the following is true?

a)

The conclusion is correct;

the program works as intended.

b)

The conclusion is incorrect; the program does not display the correct value for the test case [0, 1, 4, 5].

c)

The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.

d)

The conclusion is incorrect; using the test case [0, 1, 4, 5] only confirms that the program works for lists in increasing order.

30.

What is displayed as a result of executing the algorithm in the flowchart?

a)

5

b)

15

c)

1 2 3 4

d)

1 2 3 4 5

31.

 Two lists, list1 and list2, contain the names of books found in two different collections. A librarian wants to create newList, which will contain the names of all books found in either list, in alphabetical order, with duplicate entries removed.

Which of the following code segments will correctly create newList?

a)
b)
c)
d)
32.

An Internet service provider (ISP) is considering an update to its servers that would save copies of the Web pages most frequently visited by each user. Which of the following is LEAST likely to occur as a result of the update?

a)

Average response time for user requests might decrease.

b)

Privacy of users might be negatively affected.

c)

Storage requirements for the servers might increase.

d)

Web sites that are not visited frequently might no longer be accessible to users.

33.

Which of the following is a characteristic of the fault-tolerant nature of routing on the Internet?

a)

The ability to use a hierarchical naming system to avoid naming conflicts

b)

The ability to provide data transmission even when some connections have failed

c)

 The ability to resolve errors in domain name system (DNS) lookups

d)

The ability to use multiple protocols such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP) to transfer data

34.

A car manufacturer uses simulation software during the design process for a new car. Which of the following are reasons to use simulation software in this context?

I. Using simulation software can save the company money by helping to compare designs early in the process, before prototype cars are built.

II. Using simulation software can help to identify safety issues by providing data about how different mechanical components will interact in a wide variety of situations.

III. The manufacturer can present simulation software to customers to demonstrate different design possibilities.

a)

I and II only

b)

I and II only

c)

II and III only

d)

I, II, and III

35.

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.

36.

Programs I and II are each intended to calculate the sum of the integers from 1 to n. Assume that n is a positive integer (e.g., 1, 2, 3, …).

Which of the following best describes the behavior of the two programs?

a)

Program I displays the correct sum, but program II does not.

b)

Program II displays the correct sum, but program I does not.

c)

Both program I and program II display the correct sum.

d)

Neither program I nor program II displays the correct sum.

37.

A large data set contains information about all students majoring in computer science in colleges across the United States. The data set contains the following information about each student.

• The student’s gender

• The state in which the student attends college

• The student’s grade point average on a 4.0 scale

Which of the following questions could be answered by analyzing only information in the data set?

a)

Do students majoring in computer science tend to have higher grade point averages than students majoring in other subjects?

b)

How many states have a higher percentage of female computer science majors than male computer science majors attending college in that state?

c)

What percent of students attending college in a certain state are majoring in computer science?

d)

Which college has the highest number of students majoring in computer science?

38.

Which of the following is a true statement about cloud computing?

a)

Cloud computing is convenient to implement but has a negative effect on the scalability of systems.

b)

Cloud computing is useful for large businesses but is not useful for individuals.

c)

Storing data using cloud computing can help ensure that data are not lost if a user’s computer stops functioning.

d)

Storing data using cloud computing improves security over storing data on a personal computer.

39.

Which of the following statements is true?

a)

Every problem can be solved with an algorithm for all possible inputs, in a reasonable amount of time, using a modern computer.

b)

Every problem can be solved with an algorithm for all possible inputs, but some will take more than 100 years, even with the fastest possible computer.

c)

Every problem can be solved with an algorithm for all possible inputs, but some of these algorithms have not been discovered yet.

d)

There exist problems that no algorithm will ever be able to solve for all possible inputs.

40.

Consider the following numbers.

• Binary 1100

• Decimal 11

• Hexadecimal D

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

a)

Binary 1100, Decimal 11, Hexadecimal D

b)

 Decimal 11, Binary 1100, Hexadecimal D

c)

Decimal 11, Hexadecimal D, Binary 1100

d)

Hexadecimal D, Decimal 11, Binary 1100

41.

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

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.

42.

A search engine has a trend-tracking feature that provides information on how popular a search term is. The data can be filtered by geographic region, date, and category. Categories include arts and entertainment, computers and electronics, games, news, people and society, shopping, sports, and travel.

Which of the following questions is LEAST likely to be answerable using the trends feature?

a)

In what month does a particular sport receive the most searches?

b)

 In which political candidates are people interested?

c)

What is the cost of a certain electronics product?

d)

Which region of the country has the greatest number of people searching for opera performances?

43.

A retailer that sells footwear maintains a single database containing records with the following information about each item for sale in the retailer’s store.

• Item identification number

• Footwear type (sneakers, boots, sandals, etc.)

• Selling price (in dollars)

• Size

• Color

• Quantity available

Using only the database, which of the following can be determined?

a)

Which items listed in the database are not currently in the store

b)

Which colors are more popular among men than women

c)

Which type of footwear is most popular among adults

d)

The total number of shoes sold in a particular month

44.

Which of the following programs is most likely to benefit from the use of a heuristic?

a)

A program that calculates a student’s grade based on the student’s quiz and homework scores

b)

A program that encrypts a folder of digital files

c)

A program that finds the shortest driving route between two locations on a map

d)

A program that sorts a list of numbers in order from least to greatest

45.

 An author is considering publishing an e-book using a Creative Commons license. In which of the following situations would it be better for the author to use a Creative Commons license instead of a traditional copyright?

I. The author wants to make the e-book available as a free download.

II. The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks.

III. The author wants to allow people permission to use and modify the e-book.

a)

I only

b)

II only

c)

I and III

d)

II and III

46.

A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet. Which of the following activities is LEAST likely to be effective in this purpose?

a)

Holding basic computer classes at community centers

b)

Providing free wireless Internet connections at locations in low-income neighborhoods

c)

Putting all government forms on the city Web site

d)

Requiring that every city school has computers that meet a minimum hardware and software standard

47.

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. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences?

a)

2 more items can be uniquely identified.

b)

10 more items can be uniquely identified.

c)

2 times as many items can be uniquely identified.

d)

10 times as many items can be uniquely identified.

48.

Which of the following has the greatest potential for compromising a user’s personal privacy?

a)

A group of cookies stored by the user’s Web browser

b)

The Internet Protocol (IP) address of the user’s computer

c)

The user’s e-mail address

d)

The user’s public key used for encryption

49.

The procedure is intended to display the index in a list of unique names (nameList) where a particular name (targetName) is found. If targetName is not found in nameList, the code should display 0.

Which of the following procedure calls can be used to demonstrate that the procedure does NOT work as intended?

a)

FindName (["Andrea", "Ben"], "Ben")

b)

FindName ([ Andrea , Ben ], Diane )

c)

FindName (["Andrea", "Ben", "Chris"], "Ben")

d)

FindName (["Andrea", "Chris", "Diane"], "Ben")

50.

 Both online newspapers and social media sites are used to distribute information on the Internet. Which of the following best describes an advantage that online newspapers have over social media sites?

a)

The ability to distribute information instantaneously

b)

The ability to provide credibility to the information distributed

c)

The ability to provide information that is widely accessible

d)

The ability to provide media-rich content for low cost

51.

 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 A.M. 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

52.

In the procedure Mystery, 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.

53.

Two grids are shown. Each grid contains a robot represented as a triangle. Both robots are initially facing left. Each robot can move into a white or gray square, but cannot move into a black region.

For which of the grids does the program correctly move the robot to the gray square?

Mr.Wirght's note: I recommend looking at the pdf for this one it was a long question and I did my best to make fit here.

a)

Grid I only

b)

Grid II only

c)

Both grid I and grid II

d)

Neither grid I nor grid II

54.

 Historically, it has been observed that computer processing speeds tend to double every two years. Which of the following best describes how technology companies can use this observation for planning purposes?

a)

 Technology companies can accurately predict the dates when new computing innovations will be available to use.

b)

Technology companies can plan to double the costs of new products each time advances in processing speed occur.

c)

Technology companies can set research and development goals based on anticipated processing speeds.

d)

 Technology companies can spend less effort developing new processors because processing speed will always improve at the observed rate.

55.

A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result?

a)

An overflow error occurred.

b)

 A round-off error occurred.

c)

 The result was affected by lossy data compression.

d)

The result was approximated by a floating-point representation.

56.

 A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always at least one number in the list.

The programmer wants to reduce the number of operations that are performed when the program is run. Which change will result in a correct program with a reduced number of operations performed?

a)

Interchanging line 1 and line 2

b)

 Interchanging line 5 and line 6

c)

Interchanging line 6 and line 7

d)

Interchanging line 7 and line 8

57.

The 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, which of the following best describes the output of the AND gate?

a)

The output will be true no matter what the value of input B is.

b)

The output will be false no matter what the value of input B is.

c)

The output will be true if input B is true; otherwise it will be false.

d)

The output will be false if input B is true; otherwise it will be true.

58.

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.

59.

Many Web browsers allow users to open anonymous windows. During a browsing session in an anonymous window, the browser does not record a browsing history or a list of downloaded files. When the anonymous window is exited, cookies created during the session are deleted. Which of the following statements about browsing sessions in an anonymous window is true?

a)

The activities of a user browsing in an anonymous window will not be visible to people who monitor the user’s network, such as the system administrator.

b)

 Items placed in a Web store’s shopping cart for future purchase during the anonymous browsing session will not be saved on the user’s computer.

c)

 A user will not be able to log in to e-mail or social media accounts during the anonymous browsing session.

d)

A user browsing in an anonymous window will be protected from viruses launched from any Web sites visited or files downloaded.

60.

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

61.

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.

62.

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.

63.

A code segment will be used to swap the values of the variables a and b using the temporary variable temp. Which of the following code segments correctly swaps the values of a and b ?

a)
b)
c)
d)
64.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the center square of the grid and facing toward the top of the grid.

The code segment is used to move the robot within the grid.

A gray square represents a possible final location of the robot after the code segment is executed. Which of the following represents all possible final locations for the robot?

a)
b)
c)
d)
65.

Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image?

a)

Compressing the image in a way that may lose information but will suffer only a small loss of image quality.

b)

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.

c)

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.

d)

Modifying part of the image by taking the pixels in one part of the picture and copying them to the pixels in another part of the picture.

66.

 In the program, y is a positive integer (e.g., 1, 2, 3, …).

What is the value of result after running the program?

a)

y + 3

b)

3y

c)

y3y^3  

d)

3y3^y  

67.

A local government uses Short Message Service (SMS) text messages to alert local residents when roads are closed.

Which of the following are true statements regarding the benefits of using SMS text messages for the purpose described?

Select two answers.

a)

SMS text messages are guaranteed to reach all residents affected by the road closures.

b)

SMS text messages are likely to reach recipients quickly.

c)

SMS text messages are useful for providing detailed detour instructions.

d)

SMS text messages can be sent to multiple recipients.

68.

Which of the following can be represented by a single binary digit?

Select two answers

a)

The position of the minute hand of a clock

b)

The remainder when dividing a whole number by 2

c)

The value of a Boolean variable

d)

The volume of a car radio

69.

Which of the following Boolean expressions are equivalent to the expression num ≥ 15 ?

Select two answers.

a)

(num > 15) AND (num = 15)

b)

(num > 15) OR (num = 15)

c)

NOT (num < 15)

d)

NOT (num < 16)

70.

Researchers have developed a simulation of packets traveling between server computers and client computers in a network. Of the following, which two outcomes are most likely to be results of the simulation?

Select two answers.

a)

Better understanding of the effect of temporarily unavailable network connections

b)

Better understanding of the effect of using hexadecimal representations for binary data

c)

 Better understanding of the impact of access to public data in identifying solutions to problems

d)

Better understanding of the impact of increased connection speeds for frequently visited servers

71.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom-right square of the grid and facing toward the top of the grid.

Which of the following code segments can be used to move the robot to the gray square?

Select two answers.

a)
b)
c)
d)
72.

Which of the following are benefits of using well-named variables in a computer program? Select two answers.

a)

The program will run faster.

b)

 The program will be easier for people to read.

c)

The program will have a greater data storage capacity.

d)

The program will be easier to modify in the future.

73.

A school library allows students to borrow laptops. A computer program is used to count the number of times a particular laptop has been borrowed from the library (borrows) and the number of times the same laptop has been returned to the library (returns). Which of the following indicate that a particular laptop is not currently borrowed?

Select two answers.

a)

The difference between borrows and returns is zero.

b)

The product of borrows and returns is a positive even number.

c)

The quotient when borrows is divided by returns is greater than 1.

d)

The sum of borrows and returns is a positive even number.

74.

In a certain district, 20 percent of the voters are expected to vote for Candidate A in an election. The computer program below is intended to simulate the result of the election with n voters, and display the number of votes received by Candidate A.

Which of the following can be used to replace <MISSING CONDITION> in line 4 so that the program works as intended?

Select two answers

a)

RANDOM(1, 5) = 1

b)

RANDOM(1, 5) ≤ 2

c)

RANDOM (1, 10) = 2

d)

RANDOM (1, 10) ≤ 2

75.

Please draw a Giant Robot