Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a JAVA question Consider the following declaration that appears in a cla

ID: 3836474 • Letter: T

Question

This is a JAVA question

Consider the following declaration that appears in a class other than TimeRecord

TimeRecod[] timeCard = new TimeRecod[100];

Assume that timeCards has been initialized with TimeRecord objects. Consider the following code segment that is intended to compute the total of all the time stored in timeCards.

TimeRecord total = new TimeRecord(0, 0);

for (int k = 0; k<timeCards.length; k++)

{ /* missing expression*/;}

Which of the following can be used to replace missing expression so that the code segment will work as intended?

A) timeCards[k].advance()

B) total +=timeCards[k].advance()

C) total.advance(timeCards[k].hours, timeCards[k].minutes)

D) total.advance(timeCards[k].getHours(), timeCards[k].getMinutes())

Explanation / Answer

Answer:D) total.advance(timeCards[k].getHours(), timeCards[k].getMinutes())

Option is D is the right way of compute the total of all the time stored in timeCards.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote