Test Correction Question #27

Correction: The variables string and Boolean are appropiate for this situation however the names s and a have no meaning and will prove to make the code segment harder to read.

Test Correction Question #28

Correction: Customers who use more than 25 unites of electricity are incorrectly charged by the code. These customers are charged only for the number of units above 25. For example, say a customer were to use 32 units of electricity, they should be charged a total of $174, $5 for the first 25 and $7 for the additional 7 units. This code segment would incorrectly charge the customer $49 for the 32 units.

Test Correction Question #35

Correction: This code segment assigns maxPS the value 50 when time > 120 and assigns maxPS the value 30 otherwise.

Test Correction Question #36

Correction: My answer would have been correct solution if i were initialized to 0 instead of 1. This code segment will generate the list [4, 6, 8, 10, 12, 14, 16, 18, 20, 22].

Test Correction Question #37

Correction: This code segment assigns both variables the original value of num1.

Test Correction Question #40

Correction: My error was not knowing that something will be displayed no matter what the values of x and y are.

Test Correction Question #42

Correction: The code segment assigns the value 4 to num3 and assigns the value 8 to num1 after initially assigning values to the variables. The value of sum at the end of the code segment is 8 + 4 + 4, or 16.

Test Correction Question #43

Correction: I was inccorect because 6 is the value of x after the code segment is executed, not the value of result.

Test Correction Question #49

Correction: I was incorrect because this code segment produces the string "onno".