Midterm Review AP Comp

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which of the following has the data type of string?

"(join(hello)(world)"

Consider the following code segment. firstList ← ["cookie", "cake", "chocolate"] secondList ← ["red", "green", "blue"] thirdList ← [] thirdList ← secondList secondList ← firstList firstList ← thirdList What are the contents of firstList after the code segment is executed?

"red", "green", "blue"

Which of the following two predicates will determine whether the value stored in (value) is both odd and a multiple of 5?

((not)value(divisible by 2)and(value)divisible by (5)) ((value)mod(2)=1 and (value)divisible by(5))

Which two of the following predicates always evaluate to False?

(Not a) and (a) (True) and (false)

Which of the following is the correct way to initialize an empty list?

(set(my list)to(list))

Consider the following code segment If x>y Display x+y Else Display x-y If the value of x is 3 and the value of y is 5, what is displayed as a result of executing the code segment?

-2

Consider the 4-bit binary numbers 0101, 1001, and 1110. Which of the following decimal values is NOT equal to one of these binary numbers?

10

Given the procedure code below, what would the expression mystery(4) report?PROCEDURE mystery(x){ RETURN(3 * x)}

12

What would be the output of (19) mod (4)

3

What are the possible results of this expression? (Pick Random 3 to 7)

3,4,5,6,7

What are the possible results of this expression? (Pick Random(1) to (4) X3)

3,6,9,12

The list wordList contains a list of 10 string values. Which of the following is a valid index for the list?

4

What are the possible results of this expression? (Pick random 1 to 5)+3

4,5,6,7,8

Which of the following initial values of the variable b would result in the variable c being set to 3 after the code segment is executed?

5

Given the procedure code below, what would the expression mystery(2) report?PROCEDURE mystery(x){ RETURN(3 * x)}

6

Given the procedure code below, what would the expression mystery(3) report?PROCEDURE mystery(x){ RETURN(3 + x)}

6

conditional

A block that controls the code based on a true-or-false condition

variable

A container that can hold one value at a time

abstract data type

A custom data type that's meaningful to your program

predicate

A hexagon-shaped reporter that asks a true/false question

sublist

A list used as an item of another list

Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm?

A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot.

list

A ordered set of items

local variable

A variable that can be set or used only in the environment in which it is defined

global variable

A variable that is usable by all scripts in the program

Which of the following is NOT a legal or ethical issue that is related to computing.

AI is now advanced enough to beat even the best humans at chess.

What is the value of this expression(item(2) of (item(1) of (state capitals))

Alabama

element

Another name for an item in a list

Which of the following is an INCORRECT statement about bandwidth?

Bandwidth is a group of interconnected computing devices capable of sending or receiving data.

Consider the following numeric values. Binary 11 Binary 1110 Decimal 10 Decimal 16 Which of the following lists the values in order from least to greatest?

Binary 11, Decimal 10, Binary 1110, Decimal 16

A company that develops educational software wants to assemble a collaborative team of developers from a variety of professional and cultural backgrounds. Which of the following is NOT considered a benefit of assembling such a team?

Collaboration that includes diverse backgrounds and perspectives can eliminate the need for software testing.

Which TWO of the following are most likely to be successful as a citizen science project?

Collecting data from samples of lake water to track the spread of various invasive species across a continent. Gathering images of wildlife to determine potential population clusters.

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.

constructor

Constructs one example of the data structure

primitive data type

Data types that are built-in

Boolean

Either true or false

Three students in different locations are collaborating on the development of an application. Which of the following strategies is LEAST likely to facilitate collaboration among the students?

Having all three students write code independently and then having one student combine the code into a program

Which of the following are true statements about the data that can be represented using binary sequences? Binary sequences can be used to represent numbers. Binary sequences can be used to represent video. Binary sequences can be used to represent controller inputs.

I, II, and III

Suppose a large group of people in a room were all born in the same year. Consider the following three algorithms, which are each intended to identify the people in the room who have the earliest birthday based on just the month and day. For example, a person born on February 10 is considered to have an earlier birthday than a person born on March 5. Which of the three algorithms will identify the correct people? Beginning with the number 1, ask if anyone was born on that day of any month. Continue with the numbers 2, 3, and so on until a positive response is received. If only one person responds, that person has the earliest birthday. If more than one person responds, determine which person was born in the earliest month, and that person or those persons have the earliest birthday. All the people in the room stand up. All standing people form pairs where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing, while the other person in the pair sits down. If there is a tie, both people sit down. Any individual not part of a pair remains standing. Continue doing this until only one person remains standing. That person has the earliest birthday. All the people in the room stand up. All standing people form pairs with another standing person that they have not previously been paired with where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing, while the other person in the pair sits down. If there is a tie, both people in the pair remain standing. Any individual not part of a pair remains standing. Continue doing this until only one person remains standing or all persons standing have the same birthday. Anyone still standing has the earliest birthday.

III only

Which two of the following are examples of selection?

If statements, where there is just an "if" block could also be an "if/else" statement

Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, they should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?

If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.

What is the difference between copyright and plagiarism?

In plagiarism, you directly or indirectly claim the work as your own.

Which of the following is a benefit of using a list as a data abstraction in a program?

Lists often allow their size to be easily updated to hold as many data values as needed.

Which of the following is an example of a nested conditional?

Look for an "If/Else" statement inside of another "If" statement

traversing

Looking at each item of the list

A programmer is developing software for a social media platform. The programmer is planning to use compression when users send attachments to other users. Which of the following is a true statement about the use of compression?

Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does.

Which of the following is NOT a reason for someone to make their own block while programming?

Make the code have everything in one block so you don't have to see all the code

The developers of a music-streaming application are updating the algorithm they use to recommend music to listeners. Which of the following strategies is LEAST likely to introduce bias into the application?

Making recommendations based on listening data gathered from a random sample of users of the application

A computer science student completes a program and asks a classmate for feedback. The classmate suggests rewriting some of the code to include more procedural abstraction. Which of the following is NOT a benefit of procedural abstraction?

Making the code run faster

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.

N

The protocols used in the Internet are

Open

Suzy recieves a suspicious email that she has won $1,000 scholarship, and to claim it, she must click on the link. This is most likely an example of:

Phishing

A mobile game tracks players' locations using GPS. The game offers special in-game items to players when they visit real-world points of interest. Which of the following best explains how bias could occur in the game?

Points of interest may be more densely located in cities, favoring players in urban areas over players in rural areas.

What is the technical term for giving a name to a block or group of blocks that complete one idea?

Procedural Abstraction

Which of the following are benefits of procedural abstraction?

Procedural abstraction makes it easier for people to read computer programs. Procedural abstraction provides an opportunity to give a name to a block of code that describes the purpose of the code block.

Which of the following actions is most likely to be effective in reducing the digital divide at a local level?

Providing free community access to computers at schools, libraries, and community centers

What happens when (a list<---b list)

Said "b list" replaces "a list"

selector

Selects one piece of the data structure

initialize

Set the starting value of a variable

Which of the following is LEAST likely to be a contributing factor to the digital divide?

Some parents prefer to limit the amount of time their children spend using computing devices or the Internet.

The figure below shows four grids, each containing a robot represented as a triangle. The robot cannot move to a black square or move beyond the edge of the grid. Which of the following algorithms will allow the robot to make a single circuit around the rectangular region of black squares, finishing in the exact location and direction that it started in each of the four grids?

Step 1: Keep moving forward, one square at a time, until the square to the right of the robot is no longer black. Step 2: Turn right and move one square forward. Step 3: Repeat steps 1 and 2 three more times.

Which answer choice correctly describes the relationship between TCP and IP

TCP prepares data to be sent through a network and checks for errors after transfer. IP routes data packets to the correct destination.

A software company is designing a mobile game system that should be able to recognize the faces of people who are playing the game and automatically load their profiles. Which of the following actions is most likely to reduce the possibility of bias in the system?

Testing the system with people of different ages, genders, and ethnicities

Which of the following best describes the relationship between the World Wide Web and the Internet?

The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet.

data abstraction

The creation and use of abstract data types in a program

Peter is trying to research about the digital divide for a project his teacher assigned. Which of the following is a true statement he could include in his project?

The digital divide is the differing of access to the Internet in different places of the world

Is the Internet fault tolerant?

The internet is fault tolerant because it has multiple pathways and routes to transmit information.

The following figure represents a network of physically linked devices labeled P through S. A line between two devices indicates a connection. Devices can communicate only through the connections shown. (Image shows connection but only through one path between each and not a full circle)

The network is not considered fault-tolerant because there is only one path between certain devices.

Which of these is NOT a predicate

The one with no sharp corners(Look for the odd one out) in this case it was the (Length of(List(a)(2)(c))

Which of the following is true regarding lossy data?

The original data is lost and cannot be recovered

The position of a runner in a race is a type of analog data. The runner's position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally?

The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

A user unintentionally installs keylogging software on a computer. Which of the following is an example of how the keylogging software can be used by an unauthorized individual to gain access to computing resources?

The software records all user input on the computer. The recorded information is transmitted to an unauthorized individual, who analyzes it to determine the user's login passwords.

A student is developing a program that allows users to look up the definitions of words that appear in a book. The student plans to perform a large number of searches through a dictionary containing words and their definitions. The student will use a procedure written by a computer scientist to quickly search the dictionary (and knows that the procedure will return a definition if one is available). The student cannot modify the search procedure written by the computer scientist but can call the procedure by supplying a word. Which of the following is a true statement about the student's use of the computer scientist's search procedure?

The student is reusing the computer scientist's procedural abstraction by knowing what the procedure does without knowing how it does it.

A city's police department has installed cameras throughout city streets. The cameras capture and store license plate data from cars driven and parked throughout the city. The authorities use recorded license plate data to identify stolen cars and to enforce parking regulations. Which of the following best describes a privacy risk that could occur if this method of data collection is misused?

The vehicle location data could be used to monitor the movements of city residents.

Which of the following would be a good comment for this procedure to describe what does?

This block makes the sprite say the squares of the numbers from 1 to 10.

composition of functions

Using the result from one block as the input to another

data type

What kind of data something is (number, text string, list, etc.)

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

Whether a certain date is a Wednesday or not The value of a Boolean variable

Which two of the following are risks to privacy that are related to computing technology?

Your phone may be recording and sharing data about you without your permission. Even data that you share with companies who don't share that data may still be exposed because of security issues.

software library

a collection of procedures that can be used in programs

iteration

a repeating program structure

Creative Commons

a specific family of copyright licenses that allow others to use, share, maybe sell, and maybe revise your work

What is NOT a characteristic of an effective, collaborative team

members work independently

open access

scholarly research reports that are available for free download, rather than requiring the permission of a journal publisher

open source

software for which you make the program's source (human-readable) code available to anyone; how people can use the program may still be restricted

free software

software that anyone can copy, use, modify, and redistribute, including commercially, provided that any modifications must be under the same license

In the following code segment, assume that a and b have been assigned integer values. sum ← 0 REPEAT a TIMES { sum ← sum + 1 } REPEAT b TIMES { sum ← sum + 1 } At the end of which of the following code segments is the value of sum the same as the value of sum at the end of the preceding code segment?

sum ← 0 c ← a + b REPEAT c TIMES { sum ← sum + 1 } sum ← 0 REPEAT b TIMES { sum ← sum + 1 } REPEAT a TIMES { sum ← sum + 1 }

Which of the following code segments can be used to update the values of the variables as shown in the table?

temp ← word1 word1 ← word3 word3 ← temp

Which of the following code segments can be used to interchange the values of the variables num1 and num2 ?

temp<--num1 num1<--num2 num2<--temp

sequencing

the application of each step of an algorithm in the order in which the code statements are given

Concatenation

the linking or joining of two things to achieve a certain result

index

the position of an element in a list or the position of a character in a string


संबंधित स्टडी सेट्स

Chapter 29 Fluids, Electrolytes, and Introduction to Acid-Base Balance

View Set

Small Group Communication Midterm

View Set

NUR 230: Ch. 14 - Assessing Skin, Hair, and Nails (PrepU)

View Set

Chapter 1: Understanding the Digital Forensics Profession and Investigations

View Set

Unfair Trade & Claims Settlement Practices

View Set

3060 Final Exam CH 15-18, 24, 26, 27

View Set