Questions I got wrong and Corrections. Score: 43/50
Question 5
Question 28
This code segment incorrectly charges customers who use more than 25 units of electricity. These customers are charged $7 per unit for all units, when they should be charged this rate only for the number of units above 25. 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 $224 for the 32 units.
Question 35
The last line in this code segment sets maxPS to 50 regardless of the value of time.
Question 42
After initially assigning values to the variables, the code segment assigns the value 4 to num3 and assigns the value 8 to num1. The value of sum at the end of the code segment is 8 + 4 + 4, or 16.
Question 43
This is the value of x after the code segment is executed, not the value of result.
Question 47
The eighth statement assigns the value of c + d / 2 (which is 50) to d.
Question 50
This statement concatenates firstName and lastName and then assigns the first character of the result (which is the first character of firstName) to initials.