# 2 questions

Daniel Lucas

Ranch Hand

Posts: 48

posted 10 years ago

Alright I'm doing two AP test questions, and they both use the same code segment. Here it is(my analysis is below):

My analysis for question 8:

This is just a mathematical equation that's missing. First thing I notice is it needs to declare what both hours and minutes are, so it needs to be C or D. The only difference between C and D is C uses division whereas D uses modulus. Using modulus would be incorrect because say you had 3 hours + 90 minutes % 60, you would get 3 + 30, which is incorrect. So the answer must be C. *checks answer* yep, it's C.

My analysis for question 9:

Again I need to figure out which answer choice can be used to replace the missing expression to make it work as intended. In this case I'm missing the expression within the for statement. The intention is to compute the total of all the times stored in timeCards. So let's look at the answer choices:

A. This has no mathematical expression to compute the total.

B. This does not specify the format for the total.

C. C and D look like what we're trying to get, but it is necessary since the user is not inputting the hours and minutes to get them.

D. This answer choice gets the hours and minutes, making it the best answer choice IMO.

E. This does not even show a total, and is similar to D.

So I'm going to go with D. Am I right? *checks answer* Yep, it's D. Dunno if my reasoning is correct though

My analysis for question 8:

This is just a mathematical equation that's missing. First thing I notice is it needs to declare what both hours and minutes are, so it needs to be C or D. The only difference between C and D is C uses division whereas D uses modulus. Using modulus would be incorrect because say you had 3 hours + 90 minutes % 60, you would get 3 + 30, which is incorrect. So the answer must be C. *checks answer* yep, it's C.

My analysis for question 9:

Again I need to figure out which answer choice can be used to replace the missing expression to make it work as intended. In this case I'm missing the expression within the for statement. The intention is to compute the total of all the times stored in timeCards. So let's look at the answer choices:

A. This has no mathematical expression to compute the total.

B. This does not specify the format for the total.

C. C and D look like what we're trying to get, but it is necessary since the user is not inputting the hours and minutes to get them.

D. This answer choice gets the hours and minutes, making it the best answer choice IMO.

E. This does not even show a total, and is similar to D.

So I'm going to go with D. Am I right? *checks answer* Yep, it's D. Dunno if my reasoning is correct though