AP Computer Science Midterm

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What will be the result of 18 % 5?

3

Which of the following elements would be considered part of the user interface(UI) for an app? Choose all that apply

A button that appears on the screen An audible click that happens when the user taps the button An error message that appears when something goes wrong

A binary question is defined as

A question which can be answered in only one of two possible ways

ASCII is an acronym for

American Standard Code for Information Interchange

If Alice wishes to send Bob an encrypted message using public-key encryption, she should encrypt her message with ________________.

Bob's public key

Which of the following are advantages of cloud computing? Choose all that applies

Cloud computing relieves users from having to backup their own data and information Cloud computing makes it easier to share information Users can access information that is on the cloud from anywhere that has an Internet Connection.

In which way does y increase on an image?

From top to bottom

Which of the following actions could be used to help reduce the digital divide? I. Providing free education and training on how to use computing devices II. Providing free or low-cost computing devices to low-income individuals III. Providing networks and infrastructure to people in remote areas

I, II, and III

The figure below shows a circuit composed of two logic gates. The output of the circuit is true. Which of the following is a true statement about input A?

Input A must be true.

The Internet ____________________(choose all that applies)

Is a network of networks Connects devices and computers around the world Is based on the Internet protocol suite

Which of the following best describes one of the benefits of using an iterative and incremental process of program development?

It helps programmers identify errors as components are added to a working program.

Analytics is the computational analysis of data. There are many types of analytics that people can use to properly process large data sets. Which of the following analytics type is defined incorrectly?

Monetized - analytics that require fees to be paid in order to access and process the data

One of the interesting job descriptions has the following text; "Accessing data and computing power without being granted access but with the permission of the system administrators.... Their job is to identify and repair system vulnerabilities." Which of the following jobs is being described here?

Penetration testing

The Internet is composed of many layers. Higher level layers depend on the functionality of the lower levels without worrying about precisely how those layers work. These layers in order from lower to higher are:

Physical Network, TCP, IP

What is an RFC?

Request for Comments

Which of the following is not an advantage of using simulation to solve a problem?

The simulation may create new questions

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

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

A named space that can hold a value is which of the following?

Variable

Which of the following is FALSE about event-driven programs?

Event driven programs do not implement algorithms

Which of the following is a true statement about Internet communication?

Every device connected to the Internet is assigned an Internet protocol (IP) address

Which of the following are true statements about digital certificates in Web browsers? I. Digital certificates are used to verify the ownership of encrypted keys used in secured communication. II. Digital certificates are used to verify that the connection to a Web site is fault tolerant.

I only

If I understand how the Internet works then I will be able to : (two correct responses)

Make informed choices to support or oppose decisions my government makes about access to the Internet and Make informed choices about my privacy on the internet

46. Consider the following program code. i ← 0 sum ← 0 Repeat until i = 4 i ← 1 sum ← sum + 1 i ← i + 1 display sum Which of the following best describes the result of running the program code?

Nothing is displayed; the program results in an infinite loop.

Which type of chart would best display the individual data from 1,000 individuals' daily time spent in social media?

Scatter Plot

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?

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.

Which of the following would be considered an event on your smartphone? Choose all that apply

The user taps on the screen The app plays a sound clip The phone's internal clock ticks

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

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

What is a disadvantage of the open standard of Internet addressing and routing? Select two answers.

censorship and possibility of denial of service (DoS) attacks

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

heads_counter = 2

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

j = 6

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 procedures are available to create newlist.

newList ← Combine (list1, list2) newList ← Sort (newList) newList ← RemoveDuplicates (newList)

The World Wide Web (WWW) __________ (choose all that applies)

Is a system of interlinked hypertext documents Uses the HTTP protocol Was invented by Tim Berners-Lee

Why is digital data represented in binary in computers?

It's easier, cheaper, and more reliable to build machines and devices that only have to distinguish between binary states

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 the session are deleted. Which of the following statements about browsing sessions in an anonymous window is true?

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

FOUR INDEPENDENT ALGORITHMS listed below can be executed on a row of NUMBER cards (Not FACE cards) on a table. There are an EVEN number of cards, and they are in no special order. Which of the Algorithms involves BOTH Selection and Iteration? For this question select TWO correct answers

Look over all the cards to find the smallest one, and move it to the leftmost position. Repeat and Compare the values of each pair of cards. For example, compare cards 0 and 1, compare cards 2 and 3, and so on for all pairs. Swap positions when the first card is greater than the second of the pair.

A user clicks on a website, and it begins to load immediately, but it take a long time for the pictures to load completely and pictures appear slowly, one by one. Which of the following is demonstrated by this situation?

Low bandwidth, low latency

48. The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region. BBBBG BBBBW WWWWW WBBBB TBBBB Consider the procedure MoveAndTurn below. PROCEDURE MoveAndTurn numMoves, numTurns REPEAT numMoves TIMES MOVE_FOWARD REPEAT numTurns TIMES ROTATE_RIGHT Which of the following code segments will move the robot to the gray square?

MoveAndTurn 2, 1 MoveAndTurn 4, 3 MoveAndTurn 2, 0

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is init facing right. FF TL FF F(G) Consider the procedures below. PROCEDURE MoveXTimes X REPEAT x TIMES MOVE_FOWARD PROCEDURE RightXTimes X REPEAT x TIMES ROTATE_RIGHT

MoveXTIMES 2 RightXTimes 3 MOVEXTimes 3

The code segment below 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?

Only elements that appear in both inputList1 and inputList2

Which of the following lists arranges hardware components from the lowest to the highest

Physical circuit, logic gate, ram chip, motherboard

Two classmates working on a project together don't want any of their classmates to be able to read their work, so they decide to use Caesar's Cipher where the letters are shifted left or right to encrypt their work. Caesar's Cipher is an example of which kind of encryption?

Symmetric encryption

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?

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

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?

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

A user reads reviews of a popular artist's new album and then downloads the album from the Web site of a licensed online music seller. Which if the following is LEAST likely to be a consequence of this action?

The user will be in violation of the Digital Millennium Copyright Act (DMCA).

An overflow error occurs when there aren't enough bits to represent a given number. Which of the following would cause an overflow error to occur (choose all that apply)

Trying to represent 16 in 4 bits Trying to represent 32 in 5 bits

Which of the following is an example of a cloud computing application? Choose all that applies

Twitter Gmail Facebook DropBox

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 -Size -Color -Quantity available Using only the database, which of the following can be determined?

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

An online gaming website has a list of users that has been sorted alphabetically by last name. In order to find a certain user, a binary search is performed. As many new members are added to the database, will the number of steps the algorithm will take to solve the problem most likely also increase. Why or Why not?

Yes, because the new members may not be added alphabetically

A teacher uses the following program to adjust student grades on an assignment by adding 5 points to each student's original grade. However, if adding 5 points to a student's original grade causes the grade to exceed 100 points, the student will receive the maximum possible score of 100 points. The students' original grades are stored in the list gradeList, which is indexed from 1 to n. i ← 1 REPEAT n TIMES { <MISSING CODE> i ← i + 1 } The teacher has the following procedures available. Procedure Explanation min (a, b) Returns the lesser of the two values a and b max (a, b) Returns the greater of the two values a and b Which of the following code segments can replace <MISSING CODE> so that the program works as intended? Select two answers.

gradeList[i] ← min (gradeList[i] + 5, 100) gradeList[i] ← gradeList[i] + 5 IF (gradeList[i] > 100) { gradeList[i] ← 100 }

44. An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables. Variable Description onFloor1 set to true if the elevator is stopped on floor 1; otherwise set to false onFloor2 set to true if the elevator is stopped on floor 2; otherwise set to false callTo1 set to true if the elevator is called to floor 1; otherwise set to false callTo2 set to true if the elevator is called to floor 2; otherwise set to false The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?

(onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IETF are:

A loosely organized collection of citizens and engineers who communicate mostly by email

Which of the following algorithms require both selection and iteration? Select two answers.

An algorithm that, given a list of integers, displays the number of even integers in the list An algorithm that, given a list of integers, displays only the negative integers in the list

Which of the following would be the best use of citizen science?

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

49. There are 32 students standing in a classroom. Two different algorithms are given for finding the average height of the students. Algorithm A Step 1: All students stand. Step 2: A randomly selected student writes his or her height on a card and is seated. Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased. Step 4: Repeat step 3 until no students remain standing. Step 5: The sum on the card is divided by 32. The result is given to the teacher. Algorithm B Step 1: All students stand. Step 2: Each student is given a card. Each student writes his or her height on the card. Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student's card; the other student is seated. The previous value on the card is erased. Step 4: Repeat step 3 until one student remains standing. Step 5: The sum on the last student's card is divided by 32. The result is given to the teacher. Which of the following statements is true?

Both Algorithm A and Algorithm B always calculate the correct average.

Which of the following statements describes a limitation of using a computer simulation to model a real-world object or system?

Computer simulations usually make some simplifying assumptions about the real-world object or system being modeled.

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?

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.

Which of the following are actions that a programmer could take when debugging a segment of code that would most likely lead to finding a problem and fixing it? (choose two)

Display the value of variables at various points during the program Ask a friend or collaborator to look over the code segment to see if they are able to find any errors

You decide you are going to take your internet privacy seriously. Which of the following action poses the greatest risk to your internet privacy?

Encrypting your files and sharing your private key to ensure others who you choose to share files with can read them.

Imagine you are playing an online game with your friends. You are at a crucial stage in the basketball game and need just one more free throw to win the game. You see the entire complex scene display quickly. You aim at the hoop to shoot your free throw. You click the shoot button but there is a momentary freeze on your screen only to discover that you have lost the game. What is demonstrated by this situation?

High bandwidth, high latency

47. A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions. The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise. FOR EACH child IN morningList { <MISSING CODE> } Which of the following could replace <MISSING CODE> so that the code segment works as intended?

IF (IsFound (afternoonList, child)) { APPEND (lunchList, child) }


Ensembles d'études connexes

Chap. 44 - Assessment of Digestive and Gastrointestinal Function

View Set

Advanced Pharmacology Chapter 31-32 Quiz

View Set

Present continuous for future arrangements

View Set

Ch 35 Nutritional Support Products, Vitamins, & Minerals

View Set

Prime movers of the head neck and trunk

View Set

Introduction to Insurance Billing Terminology

View Set

Application Portfolio Management ServiceNow

View Set

X-Cel, Accident and Health Insurance, Chapter 11 - Laws and Rules Pertinent to Insurance

View Set