AP CSP Test

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

Which of the following is a true statement about program documentation? A)Program documentation should not be changed after it is first written. B)Program documentation is only needed for programs in development; it is not needed after a program is completed. C)Program documentation is useful when programmers collaborate but not when a programmer works individually on a project. D)Program documentation is useful during initial program development and also when modifications are made to existing programs.

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

In computer science, experience has demonstrated that there are numerous benefits that come out of collaboration. Some benefits come from the communication that is an intrinsic part of collaboration, whether the collaboration is between individuals inside an organization or between different organizations. Which of the following is NOT a benefit that comes from communicating in collaboration? a. Bias increases. b. Team-building benefits. c. Subject-matter benefits. d. Increase in new perspectives.

a. Bias increases.

[Select TWO answers.] Which of the following strategies help programmers develop a correct program to solve problems? a. Writing part of the code and testing it before writing the next part. b. Working on all of the code in as few sittings as possible. c. Waiting until the end of writing to test the code. d. Splitting the code into components, writing and testing them separately, then combining the components.

a. Writing part of the code and testing it before writing the next part. d. Splitting the code into components, writing and testing them separately, then combining the components

In the following procedure, the parameter max is a positive integer. PROCEDURE printNums(max) { count ←← 1 REPEAT UNTIL(count > max) { DISPLAY(count) count ←← count + 2 } } Which of the following is the most appropriate documentation to appear with the printNums procedure? A)Prints all positive even integers that are less than or equal to max. B)Prints all positive odd integers that are less than or equal to max. C)Prints all positive even integers that are greater than max. D)Prints all positive odd integers that are greater than max.

B)Prints all positive odd integers that are less than or equal to max.

A chain of retail stores uses software to manage telephone calls from customers. The system was recently upgraded. Customers interacted with the original system using their phone keypad. Customers interact with the upgraded system using their voice. The upgraded system (but not the original system) stores all information from the calling session in a database for future reference. This includes the customer's telephone number and any information provided by the customer (name, address, order number, credit card number, etc.). The original system and the upgraded system are described in the following flowcharts. Each flowchart uses the following blocks. The upgraded system uses a directory containing additional information not supplied by the customer. The directory is used to help direct calls effectively. Which of the following is LEAST likely to be included in the directory? A)A list of common issues and whether each issue requires a human representative B)A list of common keywords or phrases and a corresponding issue for each keyword or phrase C)A list of computers the company owns and the computers' corresponding IP addresses D)A list of human representatives and the corresponding department for each representative

C)A list of computers the company owns and the computers' corresponding IP addresses

RunRoutr is a fitness tracking application for smartphones that creates suggested running routes so that users can run with each other. Upon downloading the application, each user creates a username, a personal profile, and a contact list of friends who also use the application. The application uses the smartphone's GPS unit to track a user's location, running speed, and distance traveled. Users can use the application to review information and statistics about their previous runs. At the beginning of a run, users indicate the distance they want to run from their current location, and the application suggests a running route. Once a user accepts a suggested route, the application shares the suggested route with other compatible users in the area so that they can run together. Users are considered compatible if they are on each other's contact lists or if they typically run at similar speeds. A basic RunRoutr account is free, but it displays advertisements that are targeted to individual users based on data collected by the application. For example, if a user's running route begins or ends near a particular store, the application may display an advertisement for that store. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Adrianna uses RunRoutr to suggest a running route. All compatible users near Adrianna receive a notification that shows her running route. Which of the following data is not obtained using data collected from Adrianna's smartphone but necessary for RunRoutr to share Adrianna's running route? A)Adrianna's average running speed B)Adrianna's preferred running distance C)The current locations of other RunRoutr users D)The usernames on Adrianna's contact list

C)The current locations of other RunRoutr users

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.

RunRoutr is a fitness tracking application for smartphones that creates suggested running routes so that users can run with each other. Upon downloading the application, each user creates a username, a personal profile, and a contact list of friends who also use the application. The application uses the smartphone's GPS unit to track a user's location, running speed, and distance traveled. Users can use the application to review information and statistics about their previous runs. At the beginning of a run, users indicate the distance they want to run from their current location, and the application suggests a running route. Once a user accepts a suggested route, the application shares the suggested route with other compatible users in the area so that they can run together. Users are considered compatible if they are on each other's contact lists or if they typically run at similar speeds.A basic RunRoutr account is free, but it displays advertisements that are targeted to individual users based on data collected by the application. For example, if a user's running route begins or ends near a particular store, the application may display an advertisement for that store. Users have the ability to pay a monthly fee for a premium account, which removes advertisements from the application. Which of the following data must be collected from a user's smartphone in order for RunRoutr to suggest a running route? A)Available running routes near the user's home B)The current time C)The starting location of the user's previous run D)The user's geographic position

D)The user's geographic position

[Select TWO answers.] Eric is going to write a program for the math teachers at his school that will help them keep track of book numbers across the department. Before he can begin planning this program, what vital information will he need? a. Any concerns that the teachers have about how the program will work. b. How many teachers are in the math department. c. What algorithms he will need in order to create the program. d. A description of what the user interface should look like and how the teachers will interact with the program.

a. Any concerns that the teachers have about how the program will work. d. A description of what the user interface should look like and how the teachers will interact with the program.

[Select TWO answers.] Which of the following practices will make collaborating with another programmer more effective? a. Each programmer should use the same documentation guidelines as they write code. b. Only one programmer should work on code at a time in order to avoid errors. c. The same programmer should do all the coding while the other programmer "navigates" and offers suggestions. d. The programmers could use online tools like Google Docs to share files and work together.

a. Each programmer should use the same documentation guidelines as they write code. d. The programmers could use online tools like Google Docs to share files and work together.

Which of the following is NOT an example of collaboration? a. Seth and Alex each decide they want to create a piece of music using a coding software. Seth and Alex discuss what genre of music they want to make, but they cannot agree. They each decide to create their own music. b. Sarah and Justin each want to create an app that will locate a car in a parking lot. They decide to work together to create the app in less time. c. Clayton and Kaylie decide to create a game for mobile phones. Kaylie has experience with the visual aspects and Clayton has experience with the logistics. Together they can make a great game. d. Andrew and Ashton each want to create the next big social media app. Andrew wants to focus on sending and receiving pictures while Ashten wants to focus on sending and receiving videos. They decide to combine their two ideas into one app.

a. Seth and Alex each decide they want to create a piece of music using a coding software. Seth and Alex discuss what genre of music they want to make, but they cannot agree. They each decide to create their own music.

A home security company develops software that takes a human voice as input, searches for the voice in a voice recognition database, and determines the identity of the person based on the voice. It is sophisticated enough to be able to distinguish a live voice from a recorded voice. The main purpose of this software is to activate and deactivate the security system at a person's home residence. Of the following, which would be the MOST logical extension of this software for another purpose? a. To allow an officer's entry into a military facility. b. To select the clothes that a person should wear today. c. To determine a driver's best route to work. d. To determine this morning's weather forecast wherever the person is located.

a. To allow an officer's entry into a military facility.

[Select TWO answers.] Bridget was a programmer for many years at a company, but then she moved on to a bigger and better job at another corporation. Sally was promoted into Bridget's old position and is now responsible for maintaining the programs that Bridget originally developed. Sally has been asked to debug the following code but is having a hard time understanding its functionality. Of the following modifications that Bridget could have made to this code before she left the company, which would have been the most useful for helping Sally better understand the code? a. Change the REPEAT UNTIL loop to a REPEAT b TIMES loop. b. Include documentation that explains the purpose of procedure a and its two parameters b and c c. Modify the DISPLAY statement to display both c and d. Replace the name of the procedure and the variables names with longer and more meaningful names.

b. Include documentation that explains the purpose of procedure a and its two parameters b and c d. Replace the name of the procedure and the variables names with longer and more meaningful names.

Vang is programming some software for a client. Which of the following will best help Vang understand what the software is supposed to do? a. Visuals showing how the user interface should appear. b. The intended outcome of several specific inputs. c. Algorithms that might help him write the programs. d. Debugging software that will help him find errors.

b. The intended outcome of several specific inputs.

Molly asks Sean to help her debug her code. She tells him that the code is supposed to take a list of names and return the alphabetically sorted list with any duplicate names in bold. Why will this information help Sean debug Molly's code? a. Knowing what the program is supposed to do will help Sean determine what strategies Molly will have to use to get her code to work. b. Knowing what the program is supposed to do will help Sean determine what algorithms Molly will need to make the code work. c. Knowing what the program is supposed to do will help Sean determine what is wrong with the code. d. Knowing what the program is supposed to do will not help Sean; it's better for him to have "fresh eyes" when looking at the code.

c. Knowing what the program is supposed to do will help Sean determine what is wrong with the code.

The following procedure is intended to return the number of times the value val appears in the list myList. The procedure does not work as intended. Which of the following changes can be made so that the procedure will work as intended? a. Changing line 6 to IF(item = count) b. Changing line 6 to IF(myList[item] = val) c. Moving the statement in line 5 so that it appears between lines 2 and 3 d. Moving the statement in line 11 so that it appears between lines 9 and 10

c. Moving the statement in line 5 so that it appears between lines 2 and 3

Which of the following would be the best explanation of the functionality of a program? a. The Tic Tac Toe program looks for spots where it can win. If there are no such spots, it checks for spots where it can block the player's move. b. The program locates the highest card in the deck by using the binary search algorithm. c. The user calculates their bill by entering the price of each item they plan to purchase. The user then clicks "calculate" to determine the total cost. d. The program asks the user for a word, then translates the word into pig latin. The program does this using the substring procedure and concatenation.

d. The program asks the user for a word, then translates the word into pig latin. The program does this using the substring procedure and concatenation.

DineOutHelper is a mobile application that people can use to select a restaurant for a group meal. Each user creates a profile with a unique username and a list of food allergies or dietary restrictions. Each user can then build a contact list of other users of the app. A user who is organizing a meal with a group selects all the members of the group from the user's contact list. The application then recommends one or more nearby restaurants based on whether the restaurant can accommodate all of the group members' allergies and dietary restrictions. Suppose that Alejandra is using DineOutHelper to organize a meal with Brandon and Cynthia. Which of the following data are needed for DineOutHelper to recommend a restaurant for the group? Each group member's list of food allergies or dietary restrictions Alejandra's geographic location The usernames of the people on Brandon and Cynthia's contact lists A)I and II only B)I and III only C)II and III only D)I, II, and III

A)I and II only

A chain of retail stores uses software to manage telephone calls from customers. The system was recently upgraded. Customers interacted with the original system using their phone keypad. Customers interact with the upgraded system using their voice. The upgraded system (but not the original system) stores all information from the calling session in a database for future reference. This includes the customer's telephone number and any information provided by the customer (name, address, order number, credit card number, etc.). The original system and the upgraded system are described in the following flowcharts. Each flowchart uses the following blocks. To direct a call to the appropriate destination, which of the following input data is needed by the upgraded system that was NOT needed by the original system? Audio signal of the customer's voice The customer's keypad selection The customer's phone number A)I only B)II only C)I and III only D)I, II, and III

A)I only

In the following procedure, the parameter numList is a list of numbers and the parameters j and k are integers. PROCEDURE swapListElements(numList, j, k) { newList ←← numList newList[j] ←← numList[k] newList[k] ←← numList[j] RETURN(newList) } Which of the following is the most appropriate documentation to appear with the swapListElements procedure? A) Returns a copy of numList with the elements at indices j and k interchanged.The value of j must be between 0 and the value of k, inclusive. B) Returns a copy of numList with the elements at indices j and k interchanged.The values of j and k must both be between 1 and LENGTH(numList), inclusive. C) Interchanges the values of the parameters j and k.The value of j must be between 0 and the value of k, inclusive. D) Interchanges the values of the parameters j and k.The values of j and k must both be between 1 and LENGTH(numList), inclusive.

B) Returns a copy of numList with the elements at indices j and k interchanged.The values of j and k must both be between 1 and LENGTH(numList), inclusive.

DineOutHelper is a mobile application that people can use to select a restaurant for a group meal. Each user creates a profile with a unique username and a list of food allergies or dietary restrictions. Each user can then build a contact list of other users of the app. A user who is organizing a meal with a group selects all the members of the group from the user's contact list. The application then recommends one or more nearby restaurants based on whether the restaurant can accommodate all of the group members' allergies and dietary restrictions. Suppose that Alejandra is using DineOutHelper to organize a meal with Brandon and Cynthia. Which of the following data is not provided by Alejandra but is necessary for DineOutHelper to recommend a restaurant for the group? Brandon's contact list Information about which restaurants Brandon and Cynthia have visited in the past Information about which food allergies and dietary restrictions can be accommodated at different restaurants near Alejandra A)II only B)III only C)II and III only D)I, II, and III

B)III only

A student wrote the following code segment, which displays true if the list myList contains any duplicate values and displays false otherwise. The code segment compares pairs of list elements, setting contains duplicates to true if any two elements are found to be equal in value. Which of the following best describes the behavior of how pairs of elements are compared? A)The code segment iterates through myList, comparing each element to all other elements in the list. B)The code segment iterates through myList, comparing each element to all subsequent elements in the list. C)The code segment iterates through myList, comparing each element to the element that immediately follows it in the list. D)The code segment iterates through myList, comparing each element to the element that immediately precedes it in the list.

B)The code segment iterates through myList, comparing each element to all subsequent elements in the list.

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

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

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

Which of the following is NOT a benefit of collaborating to develop a computing innovation? A)Collaboration can decrease the size and complexity of tasks required of individual team members. B)Collaboration can make it easier to find and correct errors during the development process. C)Collaboration eliminates the need to resolve differences of opinion. D)Collaboration facilitates multiple perspectives in developing ideas.

C)Collaboration eliminates the need to resolve differences of opinion.

In the following procedure, assume that the parameter x is an integer. Which of the following best describes the behavior of the procedure? A)It displays nothing if x is negative and displays true otherwise. B)It displays nothing if x is negative and displays false otherwise. C)It displays true if x is negative and displays nothing otherwise. D)It displays true if x is negative and displays false otherwise.

C)It displays true if x is negative and displays nothing otherwise.

Which of the following actions are generally helpful in program development? I) Consulting potential users of the program to identify their concerns II)Writing and testing small code segments before adding them to the program III)Collaborating with other individuals when developing a large program A)I and II only B) I and III only C) II and III only D) I, II, and III

D) I, II, and III

A company that develops mobile applications wants to involve users in the software development process. Which of the following best explains the benefit in having users participate? A)Users can identify and correct errors they encounter when using released versions of the software. B)Users can review the algorithms used in the software to help improve their efficiency. C)Users can provide documentation for program code at the end of the software development process. D)Users can provide feedback that can be used to incorporate a variety of perspectives into the software.

D)Users can provide feedback that can be used to incorporate a variety of perspectives into the software.


Ensembles d'études connexes

FARHANA MY DAUGHTER................

View Set

that funny moment when you you....

View Set

Mandated Child Abuse Reporting for Educators

View Set

Managing Care Potter and Perry Ch. 18

View Set

Digitial Marketing Exam Hootsuite

View Set

Bio 116 Exam 2 - Learning Outcomes

View Set

RT-240, Final Exam good questions to go over

View Set