APCSP Final

0.0(0)
studied byStudied by 3 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/158

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

159 Terms

1
New cards

The model used by the simulation software cannot be modified once the simulation has been used

A city planner is using simulation software to study crowd flow out of a large arena after an event has ended. The arena is located in an urban city. Which of the following best describes a limitation of using a simulation for this purpose?

2
New cards

Determining the longest word in a textbook

For which of the following problems is using a simulation LEAST likely to be beneficial?

3
New cards

A retail company wants to determine the most popular item that was sold on the company's Web site last month

In which of the following scenarios would a simulation be the LEAST beneficial?

4
New cards

Using a simulation may expose potential safety issues that can be corrected before construction begins

The transportation department plans to build a new high-speed train route between two cities. The transportation department wants to implement a simulation of the train before any construction begins on this project. Which of the following statements is true about the use of a simulation for this project?

5
New cards

Investigating ways to reduce the amount of trash in the ocean and Studying the effect of a genetic change in a population

In which of the following scenarios is using a simulation more beneficial than performing a calculation?

6
New cards

1 3 2 4

Consider the following code segment. Which of the following CANNOT be displayed as a result of executing the code segment?

<p>Consider the following code segment. Which of the following CANNOT be displayed as a result of executing the code segment?</p>
7
New cards

Any integer value from 7 to 16, inclusive

Consider the following code segment. Which of the following describes the possible values of ans as a result of executing the code segment?

<p>Consider the following code segment. Which of the following describes the possible values of ans as a result of executing the code segment?</p>
8
New cards

The player had 3 bonus round attempts and 7 of them earned extra points

In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player is given 1 to 4 bonus round attempts. For each attempt, the player typically earns the extra points 70% of the time and does not earn the extra points 30% of the time. The following code segment can be used to simulate the bonus round. Which of the following is NOT a possible output of this simulation?

<p>In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player is given 1 to 4 bonus round attempts. For each attempt, the player typically earns the extra points 70% of the time and does not earn the extra points 30% of the time. The following code segment can be used to simulate the bonus round. Which of the following is NOT a possible output of this simulation?</p>
9
New cards

sum ← RANDOM(1, 12) + RANDOM(1, 12) + RANDOM(1, 12)

A spinner contains 12 regions of equal size. The regions are numbered 1 to 12. Which of the following code segments can be used to simulate the results of spinning the spinner three times and assigns the sum of the values obtained by the three spins to the variable sum?

10
New cards

A procedure that returns the sum of the values in the file

A student has a data file containing 10,000 numerical values. The student is writing a program to compute the average of the numbers contained in the file. Which of the following procedures is most likely to be useful in the student's program?

11
New cards

A procedure findNegative, which returns the row number of the first negative value that appears in the column or -1 if there are no negative values

A student is writing a program that is intended to replace each negative value in a particular column of a spreadsheet with the value 0. Which of the following procedures is most likely to be useful in the student's program?

12
New cards

A procedure isFound, which takes a word and a text file as input and returns true if the word appears in the text file

Which of the following procedures would be most useful as part of a program to determine whether a word appears in two different text files?

13
New cards

A musician creates a song using samples of a copyrighted work and then uses a Creative Commons license to publish the song.

Which of the following actions is most likely to raise legal or ethical concerns?

14
New cards

The researcher can allow the results to be easily obtained by other researchers and members of the general public.

A researcher wants to publish the results of a study in an open access journal. Which of the following is a direct benefit of publishing the results in this type of publication?

15
New cards

Users of the basic version of StreamPal indirectly support StreamPal by allowing themselves to receive advertisements.

StreamPal is an audio-streaming application for mobile devices that allows users to listen to streaming music and connect with other users who have similar taste in music. After downloading the application, each user creates a username, personal profile, and contact list of friends who also use the application. The application uses the device's GPS unit to track a user's location. Each time a user listens to a song, the user can give it a rating from 0 to 5 stars. The user can access the following features for each song that the user has rated. 1. A list of users on the contact list who have given the song the same rating, with links to those users' profiles 2.A map showing all other users in the area who have given the song the same rating, with links to those users' profiles. A basic StreamPal account is free, but it displays advertisements that are based on data collected by the application. For example, if a user listens to a particular artist, the application may display an advertisement for concert tickets the next time the artist comes to the user's city. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Which of the following statements is most likely true about the differences between the basic version and the premium version of StreamPal?

16
New cards

Users of the application may have the ability to determine information about the locations of users that are not on their contact list.

Item 1StreamPal is an audio-streaming application for mobile devices that allows users to listen to streaming music and connect with other users who have similar taste in music. After downloading the application, each user creates a username, personal profile, and contact list of friends who also use the application. The application uses the device's GPS unit to track a user's location. Each time a user listens to a song, the user can give it a rating from 0 to 5 stars. The user can access the following features for each song that the user has rated. 1. A list of users on the contact list who have given the song the same rating, with links to those users' profiles 2. A map showing all other users in the area who have given the song the same rating, with links to those users' profiles. A basic StreamPal account is free, but it displays advertisements that are based on data collected by the application. For example, if a user listens to a particular artist, the application may display an advertisement for concert tickets the next time the artist comes to the user's city. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Which of the following is most likely to be a data privacy concern for StreamPal users?

17
New cards

The programmer can specify the ways that other people are legally allowed to use and distribute the software.

A programmer created a piece of software and wants to publish it using a Creative Commons license. Which of the following is a direct benefit of publishing the software with this type of license?

18
New cards

Users with visual impairments may be able to more easily read or listen to books and articles.

MeeReader is an e-reading application that allows users to download and read books and articles on a device. Each user creates a profile with the following personal preferences. 1. Screen brightness and contrast 2. Choice of typeface and font size 3. Amount of spacing between lines of text 4. Activation of a text-to-speech feature that reads the text out loud. When the user launches the application, the application scans the user's face and uses facial recognition software to determine the user's identity. Once the user has been identified, the user's personal preferences are applied to whatever book or article the user chooses to read. The application stores all user information in a database, including personal preferences and a record of previously read books and articles. Which of the following is most likely to be a beneficial effect of using MeeReader? *

19
New cards

The developers can analyze the data to make improvements to the application based on user behavior.

MeeReader is an e-reading application that allows users to download and read books and articles on a device. Each user creates a profile with the following personal preferences. 1. Screen brightness and contrast 2. Choice of typeface and font size 3. Amount of spacing between lines of text 4. Activation of a text-to-speech feature that reads the text out loud. When the user launches the application, the application scans the user's face and uses facial recognition software to determine the user's identity. Once the user has been identified, the user's personal preferences are applied to whatever book or article the user chooses to read. The application stores all user information in a database, including personal preferences and a record of previously read books and articles. From the perspective of the application's developers, which of the following is most likely to be a benefit of storing all user data in a database?

20
New cards

It prevents users from accessing infrequently used files when there is no Internet connectivity.

A software development company has created an application called FileCleanUp. When the application is run on a user device, it searches for all files (including pictures, videos, and documents) that have not been accessed in the past month, stores them on the company's Web server, and deletes them from the user device. The application runs once each day. Users have the ability to manually retrieve files from the server if they are needed. Which of the following is most likely to be a harmful effect of using FileCleanUp?

21
New cards

Deploying satellites and other infrastructure to provide inexpensive Internet access to remote areas of Earth

Which of the following actions is most likely to help reduce the digital divide?

22
New cards

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

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

23
New cards

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

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

24
New cards

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

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?

25
New cards

An application that allows users to view descriptions and photographs of local landmarks

Which of the following applications is most likely to benefit from the use of crowdsourcing?

26
New cards

Collecting pictures of plants from around the world that can be analyzed to look for regional differences in plant growth.

Which of the following activities is most likely to be successful as a citizen science project?

27
New cards

Users can submit updates on local traffic conditions in real time.

A mobile application is used to display local traffic conditions. Which of the following features of the application best exemplifies the use of crowdsourcing?

28
New cards

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

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?

29
New cards

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

What is a benefit of using a list as a data abstraction in a program

30
New cards

Keeping the numeric values in a list makes it easier to apply the same computation to every data element.

A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of using a list as a data abstraction in this situation?

31
New cards

"h"

Assume that both lists and strings are indexed starting with index 1. The list wordList has the following contents. Let myWord be the element at index 3 of wordList. Let myChar be the character at index 2 of myWord. What is the value of myChar ?

["abc", "def:, "ghi", "jkl"]

32
New cards

["guitar", "drums", "bass"]

Consider the following code segment. What are the contents of secondList after the code segment is executed?

first list -- ["guitar", "drums", "bass"]

secondlist-- ["flute", "violin"]

thirdlist -- []

thirdlist-- firstlist

firstlist-- secondlist

secondlist -- thirdlist

33
New cards

4

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

34
New cards

[10, 30, 50, 70]

refer to 4th picture, march 24&25th

<p>refer to 4th picture, march 24&amp;25th</p>
35
New cards

number

The variable age is to be used to represent a person's age, in years. Which of the following is the most appropriate data type for age ?

36
New cards

list

The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen

37
New cards

A string variable named studentName and a Boolean variable named isAbsent

A teacher is writing a code segment that will use variables to represent a student's name and whether or not the student is currently absent. Which of the following variables are MOST appropriate for the code segment?

38
New cards

The value of first is true, and the value of second is true.

Consider the following code segment. What are the values of first and second as a result of executing the code segment?

first--- true

second-- false

second--first

first--second

39
New cards

x and z only

Consider the following code segment. Which of the variables have the value 50 after executing the code segment?

x-- 25

y--50

z--75

x--y

y--z

z--x

40
New cards

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

41
New cards

After clicking the link, a Web page opens that prompts the recipient for personal information.

An individual receives an e-mail that appears to be from an insurance company. The message offers a low insurance rate, and prompts the recipient to click a link to learn more. Which of the following is most indicative that the e-mail is part of a phishing attempt?

42
New cards

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

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?

43
New cards

A Web site requires a user to enter a password as well as a numeric code received via text message before the user can log in to an account.

Which of the following best exemplifies the use of multifactor authentication?

44
New cards

The Internet is fault-tolerant because there are usually multiple paths between devices, allowing messages to sometimes be sent even when parts of the network fail.

Which of the following best explains how the Internet is a fault-tolerant system?

45
New cards

If one component of the system fails, users of the system can often still access it.

Which of the following is a primary benefit of making a computing system fault-tolerant?

46
New cards

3

The figure to the left represents a network of physically linked devices, labeled A through H. A line between two devices indicates a connection. Devices can communicate only through the connections shown. What is the minimum number of connections that would need to be removed from the network in order for device A to not be able to communicate with device F?

<p>The figure to the left represents a network of physically linked devices, labeled A through H. A line between two devices indicates a connection. Devices can communicate only through the connections shown. What is the minimum number of connections that would need to be removed from the network in order for device A to not be able to communicate with device F?</p>
47
New cards

The efficiency of a solution that can be broken down into parallel portions is still limited by a sequential portion.

Which of the following best describes the ability of parallel computing solutions to improve efficiency?

48
New cards

Processes W and Z should be assigned to one processor, and processes X and Y should be assigned to the other processor.

A computer has two processors that are able to run in parallel. The table below indicates the amount of time it takes either processor to execute four different processes. Assume that none of the processes is dependent on any of the other processes. A program is used to assign processes to each of the processors. Which of the following describes how the program should assign the four processes to optimize execution time?

<p>A computer has two processors that are able to run in parallel. The table below indicates the amount of time it takes either processor to execute four different processes. Assume that none of the processes is dependent on any of the other processes. A program is used to assign processes to each of the processors. Which of the following describes how the program should assign the four processes to optimize execution time?</p>
49
New cards

The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device.

Which of the following best explains how messages are typically transmitted over the Internet?

50
New cards

Open protocols provide a way to standardize data transmission between different devices.

Which of the following is a primary reason for the use of open protocols on the Internet?

51
New cards

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

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

52
New cards

The network is considered fault-tolerant because there are redundant paths between each pair of devices.

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. Which of the following statements best explains the ability of the network to provide fault tolerance?

<p>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. Which of the following statements best explains the ability of the network to provide fault tolerance?</p>
53
New cards

By providing multiple paths between devices, enabling routing to occur even in the presence of a failed component

Which of the following best explains how fault tolerance in a network is achieved?

54
New cards

(genre = "mystery") AND ((1 ≤ num) AND (cost < 10.00))

A large spreadsheet contains the following information about the books at a bookstore. A sample portion of the spreadsheet is shown below. An employee wants to count the number of books that meet all of the following criteria. For a given row in the spreadsheet, suppose genre contains the genre as a string, num contains the number of copies in stock as a number, and cost contains the cost as a number. Which of the following expressions will evaluate to true if the book should be counted and evaluates to false otherwise?

<p>A large spreadsheet contains the following information about the books at a bookstore. A sample portion of the spreadsheet is shown below. An employee wants to count the number of books that meet all of the following criteria. For a given row in the spreadsheet, suppose genre contains the genre as a string, num contains the number of copies in stock as a number, and cost contains the cost as a number. Which of the following expressions will evaluate to true if the book should be counted and evaluates to false otherwise?</p>
55
New cards

The total number of items purchased on a given date can be determined by searching the data for all transactions that occurred on the given date and then adding the number of items purchased for each matching transaction.

The owner of a clothing store records the following information for each transaction made at the store during a 7-day period. Customers can pay for purchases using cash, check, a debit card, or a credit card. Using only the data collected during the 7-day period, which of the following statements is true?

<p>The owner of a clothing store records the following information for each transaction made at the store during a 7-day period. Customers can pay for purchases using cash, check, a debit card, or a credit card. Using only the data collected during the 7-day period, which of the following statements is true?</p>
56
New cards

Use the products file to generate a list of product IDs that use AA batteries, then use the list of product IDs to search the purchases file to generate a list of customer IDs, then use the list of customer IDs to search the customers file to generate a list of e-mail addresses

A company uses the following data files. A new rechargeable battery pack is available for products that use AA batteries. Which of the following best explains how the data files in the table can be used to send a targeted e-mail to only those customers who have purchased products that use AA batteries to let them know about the new accessory?

<p>A company uses the following data files. A new rechargeable battery pack is available for products that use AA batteries. Which of the following best explains how the data files in the table can be used to send a targeted e-mail to only those customers who have purchased products that use AA batteries to let them know about the new accessory?</p>
57
New cards

Filter by photographer, then filter by year, then sort by year. Sort by subject, then sort by year, then filter by photographer.

A large spreadsheet contains information about the photographs in a museum's collection. A sample portion of the spreadsheet is shown below. In column A, each unknown photographer is set to "(unknown)". In column C, each unknown year is set to -1. A student is developing an algorithm to determine the name of the photographer who took the oldest photograph in the collection. Photographs whose photographer or year are unknown are to be ignored. Once the algorithm is complete, the desired entry will appear in the first row of the spreadsheet. If there are multiple entries that meet the desired criteria, then any of them can appear in the first row. The student has the following actions available. Assume that applying either of the filters will not change the relative order of the rows remaining in the spreadsheet. Which of the following sequences of steps can be used to identify the desired entry?

<p>A large spreadsheet contains information about the photographs in a museum's collection. A sample portion of the spreadsheet is shown below. In column A, each unknown photographer is set to "(unknown)". In column C, each unknown year is set to -1. A student is developing an algorithm to determine the name of the photographer who took the oldest photograph in the collection. Photographs whose photographer or year are unknown are to be ignored. Once the algorithm is complete, the desired entry will appear in the first row of the spreadsheet. If there are multiple entries that meet the desired criteria, then any of them can appear in the first row. The student has the following actions available. Assume that applying either of the filters will not change the relative order of the rows remaining in the spreadsheet. Which of the following sequences of steps can be used to identify the desired entry?</p>
58
New cards

Both databases are needed. Each database can be searched by animal name to find all information to be displayed.

A wildlife preserve is developing an interactive exhibit for its guests. The exhibit is intended to allow guests to select the name of an animal on a touch screen and display various facts about the selected animal. For example, if a guest selects the animal name "wolf," the exhibit is intended to display the following information. The preserve has two databases of information available to use for the exhibit. The first database contains information for each animal's name, classification, skin type, and thermoregulation. The second database contains information for each animal's name, lifestyle, average life span, and top speed. Which of the following explains how the two databases can be used to develop the interactive exhibit?

<p>A wildlife preserve is developing an interactive exhibit for its guests. The exhibit is intended to allow guests to select the name of an animal on a touch screen and display various facts about the selected animal. For example, if a guest selects the animal name "wolf," the exhibit is intended to display the following information. The preserve has two databases of information available to use for the exhibit. The first database contains information for each animal's name, classification, skin type, and thermoregulation. The second database contains information for each animal's name, lifestyle, average life span, and top speed. Which of the following explains how the two databases can be used to develop the interactive exhibit?</p>
59
New cards

100 300 500

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

<p>Consider the following code segment. What is displayed as a result of executing the code segment?</p>
60
New cards

FOR EACH vote IN voteList

Shoppers at a mall were asked whether they preferred wearing gloves or mittens in cold weather. Shoppers' preferences were stored in the list voteList as strings, with the string "Gloves" representing a preference for gloves and the string "Mittens" representing a preference for mittens. The following code segment is intended to traverse the list and display the number of shoppers who chose gloves and the number of shoppers who chose mittens. Which of the following should replace so that the code segment works as intended?

<p>Shoppers at a mall were asked whether they preferred wearing gloves or mittens in cold weather. Shoppers' preferences were stored in the list voteList as strings, with the string "Gloves" representing a preference for gloves and the string "Mittens" representing a preference for mittens. The following code segment is intended to traverse the list and display the number of shoppers who chose gloves and the number of shoppers who chose mittens. Which of the following should replace <missing code=""> so that the code segment works as intended?</missing></p>
61
New cards

14

Consider the following code segment, which is intended to store ten consecutive even integers, beginning with 2, in the list evenList. Assume that evenList is initially empty. Which of the following can be used to replace so that the code segment works as intended?

<p>Consider the following code segment, which is intended to store ten consecutive even integers, beginning with 2, in the list evenList. Assume that evenList is initially empty. Which of the following can be used to replace <missing code=""> so that the code segment works as intended?</missing></p>
62
New cards

picture C

see quiz 4/15 for pictures

Consider the following code segment. Assume that index1 is a number between 1 and LENGTH(theList), inclusive. What is the largest possible value that the variable x can have after the code segment executes?

See quiz 4/15 for picture

<p>Consider the following code segment. Assume that index1 is a number between 1 and LENGTH(theList), inclusive. What is the largest possible value that the variable x can have after the code segment executes?</p><p>See quiz 4/15 for picture</p>
63
New cards

picture A

A teacher stores the most recent quiz scores for her class in the list scores. The first element in the list holds the maximum possible number of points that can be awarded on the quiz, and each remaining element holds one student's quiz score. Assume that scores contains at least two elements. Which of the following code segments will set the variable found to true if at least one student scored the maximum possible number of points on the quiz and will set found to false otherwise?

<p>A teacher stores the most recent quiz scores for her class in the list scores. The first element in the list holds the maximum possible number of points that can be awarded on the quiz, and each remaining element holds one student's quiz score. Assume that scores contains at least two elements. Which of the following code segments will set the variable found to true if at least one student scored the maximum possible number of points on the quiz and will set found to false otherwise?</p>
64
New cards

count1 = 2, count2 = 3

Consider the following code segment. What are the values of count1 and count2 as a result of executing the code segment?

<p>Consider the following code segment. What are the values of count1 and count2 as a result of executing the code segment?</p>
65
New cards

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.

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?

<p>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?</p>
66
New cards

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.

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?

67
New cards

Picture B

Consider the following code segment with an integer variable num. Which of the following code segments is equivalent to the code segment above?

<p>Consider the following code segment with an integer variable num. Which of the following code segments is equivalent to the code segment above?</p>
68
New cards

Inserting the statement count ← count + 1 between line 6 and line 7

The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially facing toward the top of the grid. Consider the goal of modifying the code segment to count the number of squares the robot visits before execution terminates. Which of the following modifications can be made to the code segment to correctly count the number of squares the robot moves to?

<p>The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially facing toward the top of the grid. Consider the goal of modifying the code segment to count the number of squares the robot visits before execution terminates. Which of the following modifications can be made to the code segment to correctly count the number of squares the robot moves to?</p>
69
New cards

No change is needed; the algorithm is correct as is.

The following grid contains a robot represented as a triangle, which is initially in the bottom-left square of the grid and facing the top of the grid. The robot can move into a white or a gray square but cannot move into a black region. The following code segment implements an algorithm that moves the robot from its initial position to the gray square and facing the top of the grid. When the robot reaches the gray square, it turns around and faces the bottom of the grid. Which of the following changes, if any, should be made to the code segment to move the robot back to its original position in the bottom-left square of the grid and facing toward the bottom of the grid?

<p>The following grid contains a robot represented as a triangle, which is initially in the bottom-left square of the grid and facing the top of the grid. The robot can move into a white or a gray square but cannot move into a black region. The following code segment implements an algorithm that moves the robot from its initial position to the gray square and facing the top of the grid. When the robot reaches the gray square, it turns around and faces the bottom of the grid. Which of the following changes, if any, should be made to the code segment to move the robot back to its original position in the bottom-left square of the grid and facing toward the bottom of the grid?</p>
70
New cards

II only

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? I. 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. II. 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. 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. *

71
New cards

REPEAT 2 TIMES

The following grid contains a robot represented as a triangle, which is initially facing right. The following code segment is intended to move the robot to the gray square. Which of the following can be used as a replacement for so that the code segment works as intended?

See quiz 4/8 for picture

72
New cards

Picture D

The following grid contains a robot represented as a triangle, which is initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region. Which of the following code segments can be used to move the robot to the gray square?

See picture 4/8 for picture

73
New cards

true true true

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

See quiz 4/8 for picture

74
New cards

An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15.

A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation?

75
New cards

Four bits are enough to store the eight directions.

A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. Which of the following statements is true about how the eight directions must be stored in memory?

76
New cards

I, II, and III

Which of the following are true statements about the data that can be represented using binary sequences?

See 2/16 for picture

77
New cards

9

Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers?

78
New cards

Decimal 5, binary 1011, decimal 12, binary 1101

Consider the following numeric values. Which of the following lists the values in order from least to greatest?

See 2/16 for picture

79
New cards

Step 1: Subtract num1 from num2 and store the result in the variable diff. Step 2: Take the absolute value of diff and display the result.

A student is creating an algorithm to display the distance between the numbers num1 and num2 on a number line. The following table shows the distance for several different values. Which of the following algorithms displays the correct distance for all possible values of num1 and num2 ?

Picture on 3/29

80
New cards

temp<--num1

num1<---num2

num2<---temp

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

81
New cards

temp<--word1

word1<---word3

word3<---temp

Three words are stored in the variables word1, word2, and word3. The values of the variables are to be updated as shown in the following table. Which of the following code segments can be used to update the values of the variables as shown in the table? Picture on 3/29

82
New cards

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-world position, and a sequence of bits is used to represent each sample.

83
New cards

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.

84
New cards

A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user's needs?

Compressing the file using a lossless compression algorithm before uploading it

85
New cards

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.

86
New cards

A researcher is analyzing data about students in a school district to determine whether there is a relationship between grade point average and number of absences. The researcher plans on compiling data from several sources to create a record for each student. The researcher has access to a database with the following information about each student. The researcher also has access to another database with the following information about each student. Upon compiling the data, the researcher identifies a problem due to the fact that neither data source uses a unique ID number for each student. Which of the following best describes the problem caused by the lack of unique ID numbers?

Refer to 2/22 for pic

Students who have the same name may be confused with each other.

87
New cards

A student is creating a Web site that is intended to display information about a city based on a city name that a user enters in a text field. Which of the following are likely to be challenges associated with processing city names that users might provide as input?

Users might enter abbreviations for the names of cities. Users might misspell the name of the city.

88
New cards

A team of researchers wants to create a program to analyze the amount of pollution reported in roughly 3,000 counties across the United States. The program is intended to combine county data sets and then process the data. Which of the following is most likely to be a challenge in creating the program?

Different counties may organize data in different ways.

89
New cards

A database of information about shows at a concert venue contains the following information. Which of the following additional pieces of information would be most useful in determining the artist with the greatest attendance during a particular month?

2/22 for pic

Average ticket price

90
New cards

A camera mounted on the dashboard of a car captures an image of the view from the driver's seat every second. Each image is stored as data. Along with each image, the camera also captures and stores the car's speed, the date and time, and the car's GPS location as metadata. Which of the following can best be determined using only the data and none of the metadata?

The number of bicycles the car passed on a particular day

91
New cards

21 40 30 50

Consider the following code segment. What is displayed as a result of executing the code segment? see picture on 3/29

92
New cards

c

Consider the following procedures for string manipulation. Which of the following code segments can be used to store "noon" in the string variable word ? see pic on 3/31

93
New cards

initials ← concat(prefix(firstName, 1), prefix(lastName, 1))

Consider the following procedures for string manipulation. The variable initials is to be assigned a string consisting of the first letter of the string firstName followed by the first letter of the string lastName. Which of the following assigns the correct string to initials ? see pic on 3/31

94
New cards

val1 = false, val2 = false

the following code segment is used to determine whether a customer is eligible for a discount on a movie ticket. If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the code segment?

95
New cards

When the value of exam is 80 and the value of presentation is 60

Consider the following code segment, where exam and presentation are integer variables and grade is a string variable. Under which of the following conditions will the value "C" be assigned to the variable grade ?see pic on 4/6

96
New cards

a

three teams (Team A, Team B, and Team C) are participating in a trivia contest. Let scoreA represent the number of correct questions for Team A, scoreB represent the number of correct questions for Team B, and scoreC represent the number of correct questions for Team C. Assuming no two teams get the same number of correct questions, which of the following code segments correctly displays the team with the highest number of correct questions? see pic on 4/6

97
New cards

three

Consider the following code segment with integer variables x and y. If x has a value of 7 and y has a value of 20, what is displayed as a result of executing the code segment? see pic on 4/6

98
New cards

5

Consider the following code segment. If the value of score1 is 350 and the value of score2 is 210, what will be the value of result after the code segment is executed? see pic on 4/6

99
New cards

True

What does this expression evaluate to 3==3

100
New cards

False

What does this expression evaluate to 3!=3