APCSP Test 1 review

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

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

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

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 ? A Boolean B number C string D list

A Boolean

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 and facing toward the top of the grid. The following code segment is used to move the robot in the grid. count ←← 1 REPEAT 4 TIMES { REPEAT count TIMES { MOVE_FORWARD() } ROTATE_LEFT() count ←← count + 1 } Which of the following code segments will move the robot from the center square along the same path as the code segment above? A count ←← 0 REPEAT 4 TIMES { count ←← count + 1 REPEAT count TIMES { MOVE_FORWARD() } ROTATE_LEFT() } B count ←← 0 REPEAT 4 TIMES { count ←← count + 1 ROTATE_LEFT() REPEAT count TIMES { MOVE_FORWARD() } } C count ←← 0 REPEAT 4 TIMES { REPEAT count TIMES { ROTATE_LEFT() } MOVE_FORWARD() count ←← count + 1 } D count ←← 0 REPEAT 4 TIMES { ROTATE_LEFT() REPEAT count TIMES { MOVE_FORWARD() } count ←← count + 1 }

A count ←← 0 REPEAT 4 TIMES { count ←← count + 1 REPEAT count TIMES { MOVE_FORWARD() } ROTATE_LEFT() }

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? A Collaboration that includes diverse backgrounds and perspectives can eliminate the need for software testing. B Collaboration that includes diverse backgrounds and perspectives can help the team anticipate the needs of a variety of software users. C Collaboration that includes diverse backgrounds and perspectives can help the team avoid bias. D Collaboration that includes diverse backgrounds and perspectives can reflect the strengths of the individual team members.

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

In a certain game, the integer variable bonus is assigned a value based on the value of the integer variable score. If score is greater than 100, bonus is assigned a value that is 10 times score. If score is between 50 and 100 inclusive, bonus is assigned the value of score. If score is less than 50, bonus is assigned a value of 0. Which of the following code segments assigns bonus correctly for all possible integer values of score ? Select two answers. A IF(score > 100) { bonus ←← score * 10 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← 0 } } B IF(score ≥ 50) { IF(score > 100) { bonus ←← score * 10 } ELSE { bonus ←← 0 } } ELSE { bonus ←← score } C IF(score < 50) { bonus ←← 0 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← score * 10 } } D IF(score < 50) { bonus ←← 0 } ELSE { IF(score > 100) { bonus ←← score * 10 } ELSE { bonus ←← score } }

A IF(score > 100) { bonus ←← score * 10 } ELSE { IF(score ≥ 50) { bonus ←← score } ELSE { bonus ←← 0 } }

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? A Making recommendations based on listening data gathered from a random sample of users of the application B Making recommendations based on the most frequently played songs on a local radio station C Making recommendations based on the music tastes of the developers of the application D Making recommendations based on a survey that is sent out to the 1,000 most active users of the application

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

A certain game keeps track of the maximum and minimum scores obtained so far. If num represents the most recent score obtained, which of the following algorithms correctly updates the values of the maximum and the minimum? A If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num. B If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num. C If num is less than the minimum, set the minimum equal to num. Otherwise, if num is less than the maximum, set the maximum equal to num. D If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is less than the maximum, set the maximum equal to num.

B If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num.

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.

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.

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? A Making the code more readable B Making the code run faster C Providing more opportunities for code reuse D Reducing the amount of duplicated code

B Making the code run faster

A state government is attempting to reduce the digital divide. Which of the following activities has the greatest potential to contribute to the digital divide rather than reducing it? A Providing programs that focus on technology literacy at local libraries B Requiring applicants for government jobs to apply using an online platform C Working with technology companies to offer computing devices at discounted prices to individuals with reduced incomes D Working with telecommunications companies to build network infrastructure in remote areas

B Requiring applicants for government jobs to apply using an online platform

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? A A string variable named s and a Boolean variable named a B A string variable named s and a numeric variable named n C A string variable named studentName and a Boolean variable named isAbsent D A string variable named studentName and a numeric variable named numAbsences

C A string variable named studentName and a Boolean variable named isAbsent

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? A Having all three students participate in frequent video chat sessions to discuss ideas about the project and to provide feedback on work done so far B Having all three students use an online shared folder to contribute and discuss components to be considered for use in the application C Having all three students write code independently and then having one student combine the code into a program D Having all three students work in a shared document that each can edit to provide comments on the work in progress Answer C Correct. Having group members write code in isolation is unlikely to facilitate collaboration among them. The quality of the application may suffer from the lack of communication between group members.

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

Which of the following are benefits of procedural abstraction? Select two answers. A Procedural abstraction prevents programmers from accidentally using the intellectual property of other programmers. B Procedural abstraction eliminates the need for programmers to document their code. C Procedural abstraction makes it easier for people to read computer programs. D Procedural abstraction provides an opportunity to give a name to a block of code that describes the purpose of the code block.

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

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? A If the first number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them. B 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. C 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 last number, swap them. D 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.

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

Which of the following best describes one of the benefits of using an iterative and incremental process of program development? A It allows programmers to implement algorithmic solutions to otherwise unsolvable problems. B It eliminates the need for programmers to test completed programs. C It enables programmers to create programs that use the lowest-level abstractions available. D It helps programmers identify errors as components are added to a working program.

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

Consider the following program code. Which of the following best describes the result of running the program code? A The number 0 is displayed. B The number 6 is displayed. C The number 10 is displayed. D Nothing is displayed; the program results in an infinite loop.

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

Consider the following code segment. Which of the following best describes the behavior of the code segment? A The code segment displays the value of 2(5×3)2(5×3) by initializing result to 2 and then multiplying result by 3 a total of five times. B The code segment displays the value of 2(5×3)2(5×3) by initializing result to 2 and then multiplying result by 5 a total of three times. C The code segment displays the value of 2(53)2(53) by initializing result to 2 and then multiplying result by 3 a total of five times. D The code segment displays the value of 2(53)2(53) by initializing result to 2 and then multiplying result by 5 a total of three times.

D The code segment displays the value of 2(53)2(53) by initializing result to 2 and then multiplying result by 5 a total of three times.

In public key cryptography, the sender uses the recipient's public key to encrypt a message. Which of the following is needed to decrypt the message? A The sender's public key B The sender's private key C The recipient's public key D The recipient's private key

D The recipient's private key

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? A The software gives an unauthorized individual remote access to the computer, allowing the individual to search the computer for personal information. B The software installs a virus on the computer and prompts the user to make a payment to the unauthorized individual to remove the virus. C The software prompts the user to enter personal information to verify the user's identity. This personal information is recorded and transmitted to an unauthorized individual. D 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.

D 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 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? A The cameras may not be able to read license plates in poor weather conditions. B Local business owners could lose customers who are unwilling to park in the city. C Traffic personnel who work for the city could lose their jobs if their services are no longer needed. D The vehicle location data could be used to monitor the movements of city residents.

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

A Web site uses several strategies to prevent unauthorized individuals from accessing user accounts. Which of the following is NOT an example of multifactor authentication? A Each employee for a company is issued a USB device that contains a unique token code. To log into a company computer, an employee must insert the USB device into the computer and provide a correct password. B After logging into an account from a new device, a user must enter a code that is sent via e-mail to the e-mail address on file with the account. C In order to log into an account, a user must provide both a password and a fingerprint that is captured using the user's device. D When a user enters an incorrect password more than two times in a row, the user is locked out of the account for 24 hours.

D When a user enters an incorrect password more than two times in a row, the user is locked out of the account for 24 hours.

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 variables heads_counter and flip_counter to 0. Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1. If coin_flip has the value 0, the coin flip result is heads, so heads_counter is incremented by 1. Step 3: Increment the value of flip_counter by 1. Step 4: Repeat steps 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

D heads_counter = 2

A student is creating an application that allows customers to order food for delivery from a local restaurant. Which of the following is LEAST likely to be an input provided by a customer using the application? A The address where the order should be delivered B The cost of a food item currently available for order C The credit card or payment information for the purchaser D The name of a food item to be included in the delivery

B The cost of a food item currently available for order

Consider the following program. Which of the following describes the result of executing the program? A The program displays the sum of the even integers from 2 to 10. B The program displays the sum of the even integers from 2 to 20. C The program displays the sum of the odd integers from 1 to 9. D The program displays the sum of the odd integers from 1 to 19.

B The program displays the sum of the even integers from 2 to 20.

Which of the following is NOT an advantage of using open-source software? A Open-source software is generally free or lower in cost than commercially available software. B The availability of source code makes it possible to customize open-source software to a user's individual needs. C The original developer of open-source software provides free or low-cost support for users installing and running the software. D Unlike commercial software, which can become obsolete when the company that created it goes out of business, open-source software can be updated without the involvement of the original programmers.

C The original developer of open-source software provides free or low-cost support for users installing and running the software.

Which of the following applications is most likely to benefit from the use of crowdsourcing? A An application that allows users to convert measurement units (e.g., inches to centimeters, ounces to liters) B An application that allows users to purchase tickets for a local museum C An application that allows users to compress the pictures on their devices to optimize storage space D An application that allows users to view descriptions and photographs of local landmarks

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


Kaugnay na mga set ng pag-aaral

Anatomy of the Sacrum and Coccyx

View Set

Chapter 7: Government-mandated Social Security Programs

View Set

Med surge chapter 10 principles of rehabilitation

View Set

JMC 348 Principles of Advertising- Exam one

View Set

Chapter 37: Caring for Clients with Central and Peripheral Nervous System Disorders -

View Set

Shifting the Aggregate Demand & Aggregate Supply Curve

View Set

FDR's Policies (thanks ecolowdown)

View Set