subject
Computers and Technology, 20.08.2020 18:01 nova97

Suppose that f contains an instance of the Family class whose myMembers instance variable contains at least one instance of Person. Which of the following code fragments outputs the age of the oldest Person in myMembers? I. Person p = f. myMembers. get( 0 );
for ( int i = 0 ; i < f. myMembers. size() ; i++ )
{
if ( p. getAge() < f. myMembers. get( i ).getAge() )
p = f. myMembers. get( i );
}
System. out. println( p. myAge() );

II. int i = f. getMembers().size() - 1;
int age = 0;
while ( i >= 0 )
{
if ( f. getMembers().get( i ).getAge() > age )
age = f. getMembers().get( i ).getAge();
i--;
}
System. out. println( age );

III. int n = f. getMembers().size();
Person p = null;
for ( int i = 0 ; i < n ; i++ )
{
if ( i == 0
|| f. getMembers().get( i ).getAge() > p. getAge() )
{
p = f. getMembers().get( i );
}
}
System. out. println( p. getAge() );

a. I only
b. II only
c. III only
d. II and III only
e. I, II, and III

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
What is a rush associated with alcohol?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is not a type of text format that will automatically be converted by outlook into a hyperlink?
Answers: 1
You know the right answer?
Suppose that f contains an instance of the Family class whose myMembers instance variable contains a...
Questions
question
Physics, 27.08.2020 18:01
Questions on the website: 13722360