1.1 Collaboration: 3/3

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

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

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

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

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?

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

1.2 Program Design and Development Quiz: 1/3 *was a little confused, but later realized that I was supposed to watch the CB video detailing the information in the quiz

Q1

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?

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

Q2

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?

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

Q3

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 newListj ← numListk newListk ← numListj RETURN(newList) }

Which of the following is the most appropriate documentation to appear with the swapListElements procedure?

Interchanges the values of the parameters j and k. The value of j must be between 0 and the value of k, inclusive.

1.3 Program Design and Development Quiz: 4/6

Q1 Consider the following code segment.

Which of the following best describes the behavior of the code segment?

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.

Q2 In the following procedure, assume that the parameter x is an integer.

Which of the following best describes the behavior of the procedure?

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

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

I. Each group member’s list of food allergies or dietary restrictions II. Alejandra’s geographic location III. The usernames of the people on Brandon and Cynthia’s contact lists

I and II only

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

I. Brandon’s contact list II. Information about which restaurants Brandon and Cynthia have visited in the past III. Information about which food allergies and dietary restrictions can be accommodated at different restaurants near Alejandra

II and III only

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

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

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

The cost of a food item currently available for order

Copy of Identifying and Correcting Errors Quiz 2/3

Q1

In the following code segment, score and penalty are initially positive integers. The code segment is intended to reduce the value of score by penalty. However, if doing so would cause score to be negative, score should be assigned the value 0.

For example, if score is 20 and penalty is 5, the code segment should set score to 15. If score is 20 and penalty is 30, score should be set to 0.

The code segment does not work as intended.

Line 1: IF(score - penalty < 0) Line 2: { Line 3: score ← score - penalty Line 4: } Line 5: ELSE Line 6: { Line 7: score ← 0 Line 8: }

Which of the following changes can be made so that the code segment works as intended?

Answer: Interchanging lines 3 and 7

Q2

The following procedure is intended to return true if the list of numbers myList contains only positive numbers and is intended to return false otherwise. The procedure does not work as intended.

PROCEDURE allPositive(myList) { index ← 1 len ← LENGTH(myList) REPEAT len TIMES { IF(myList[index] > 0) { RETURN(true) } index ← index + 1 } RETURN(false) }

For which of the following contents of myList does the procedure NOT return the intended result?

Answer: [-1, 0, 1] The procedure traverses this list and eventually encounters the positive value 1. At this point, the procedure returns true when it should return false because the list does not contain only positive values.

Q3

For which of the following values of numCorrect does the code segment NOT display the intended grade?

Answer: 6, 8

Internet Quiz 4.1

4.1 Video 1 Notes:

4.1 Video 2 Notes:

Q1

How are messages typically transmitted over internet? The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient’s device.

Q2

Which of the following is a primary reason for the use of open protocols on the Internet? Open protocols provide a way to standardize data transmission between different devices.

Q3

Which of the following best describes the relationship between the World Wide Web and the Internet? The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet.