Final
Final Corrections
- title: Final Corrections
- layout: base
- toc: true
- comments: true
-
categories: [Blog]
Question 5
- Incorrect. Information about which restaurants Brandon and Cynthia have visited in the past is not needed. Restaurants are recommended based on whether they can accommodate all allergies and dietary restrictions, not based on whether group members have been there before. Information about which food allergies and dietary restrictions can be accommodated at nearby restaurants is needed so that a restaurant can be recommended for the group.
Question 12
- Incorrect. The name of a food item is input that needs to be provided by the customer in order for the order to be completed.
Question 20
- Incorrect. Four bits can represent 24, or 16 pieces of information, so it is not necessary to add extra bits.
Question 28
- Incorrect. This code incorrectly charges customers who use more than 25 units of electricity. These customers are charged $7 for each of the first 25 units and $5 for each subsequent unit. For examples, if a customer used 32 units of electricity, they should be charged $5 for the first 25 and $7 for the additional 7 units (32 – 25 = 7 units), for a total charge of $174. This code segment would incorrectly charge the customer 25 * $7 + 7 * $5 = $210 for the 32 units.
Question 35
- Incorrect. This code segment sets maxPS to 50 by default, then uses the IF statement to set maxPS to 30 when time > 120.
Question 38
- Incorrect. While the list elements are strings, the indices of a list are typically nonnegative integers.
Question 41
- Incorrect. This is the value of x after the code segment is executed, not the value of result.
Question 43
- Incorrect. This is the value of x after the code segment is executed, not the value of result.