# Questions Missed -My score was 42/50 and the questions I missed were the following : #12, #28, #35, #40, #43, #44, #49, #50

Corrections

# Questions Missed

-My score was 42/50 and the questions I missed were the following : #12, #28, #35, #40, #43, #44, #49, #50

Corrections

12

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?

Answer I picked : The credit card or payment information for the purchaser Correct Answer : The cost of a food item currently available for order

-The input that should least likely be provided is the cost of a food item currently available for the order because the price of the food is already listed on the delivery website and it shouldn’t be an input because they already know the price.

28

The cost of a customer’s electricity bill is based on the number of units of electricity the customer uses.

For the first 25 units of electricity, the cost is $5 per unit. For units of electricity after the first 25, the cost is $7 per unit. Which of the following code segments correctly sets the value of the variable cost to the cost, in dollars, of using numUnits units of electricity?

image

-I picked D and the answer was C, the explanation for this is because the code charges the customers who use more than 25 units sof electricity and customers are only charged $7 for the first 25 units but $5 for each subsequent unit. (32-5=7 units).

35

In a certain video game, the variable maxPS represents the maximum possible score a player can earn. The maximum possible score depends on the time it takes the player to complete the game. The value of maxPS should be 30 if time is greater than 120 and 50 otherwise.

Which of the following code segments correctly sets the value of maxPS based on the value of time ?

Select two answers.

image

-I selected D and B. The correct answer was A and D so I got 1/2 on this question. Answer B was incorrect because it sets maxPS to 50 but it didn’t include the value fo time in it which makes it wrong. The correct answer instead of this was A because the maxPS was set to 50 on top, and not the bottom.

40

image

I selected that nothing will be displayed but that was wrong because no matter what values are plugged in for the variables given, there will always be something shown. The answer is -2 because since 3 is less than 5, the program will print 3-5=-2.

43

image

I picked answer D, which was 21 and it is incorrect because everytime, the value is getting added by 6. The answer is not 21 because it would have to be looped again and it wouldn’t add up to 15. The correct answer is 15.

44

image

I chose 2, when the correct answer is 3 because 23 is divided by 3 is 2 and 23 MOD 3 = 2

49

image

I chose the answer B, and the code will execute and produce the words in reverse, therefore making it produce the word “onon”. The correct answer is C because it produces the word No first, then produces on after which is No in reverse. Therefore creating the word noon.

50

image

I chose answer D, which was incorrect and it was incorrect because it assigns the first two characters of the result to the initials which isn’t supposed to happen, whereas option A, it correctly forms the initials because it calls to obtain the first letters of each name and bputs it in the correct order.