Unit 3 AP CSP

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

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.

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

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

The cost of a food item currently available for order

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

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

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.

Collaboration eliminates the need to resolve differences of opinion.

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.

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

In the following procedure, the parameters x and y are integers. Which of the following is the most appropriate documentation to appear with the calculate procedure? A Displays the value of x + (y / x).The value of the parameter x must not be 0. B Displays the value of x + (y / x).The value of the parameter y must not be 0. C Displays the value of (x + y) / x.The value of the parameter x must not be 0. D Displays the value of (x + y) / x.The sum of the parameters x and y must not be 0.

Displays the value of (x + y) / x.The value of the parameter x must not be 0.

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

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

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

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

I only

Which of the following actions are generally helpful in program development? Consulting potential users of the program to identify their concerns Writing and testing small code segments before adding them to the program 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

I, II, and III

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

III only

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.

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

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. 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.

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

Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. 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.

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

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.

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.

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(5^3)) 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(5^3) by initializing result to 2 and then multiplying result by 5 a total of three times.

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

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

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

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

The current locations of other RunRoutr users

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

The user's geographic position

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.

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


Ensembles d'études connexes

Algebra 1: Introduction to Quadratic Functions (100%)

View Set

Chapter 29: Life Cycles of Flowering Plants

View Set

E-3.01-3.02 Responsibility to Clients, Identifying Stakeholders

View Set