• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

2 questions

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
money grubbing section goes here:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic