These are the only answers I could not find can anyone help me out please
public class TestA {
public static void main( String args[] )
{
int x = 2, y = 20, counter = 0;
for ( int j = y % x; j < 100; j += ( y / x ) ) {
counter++;
}
}
}
public class TestB {
public static void main(String args[])
{
int counter = 0;
for ( int j = 10; j > 0; --j ) {
++counter;
}
}
}
Which of the following statements is true ( circle all that apply, or none )?
a.The value of counter will be the different at the end of each for loop for each class.
b.The value of j will be the same for each loop for all iterations
c.Both (a) and (b) are true.
d.Neither (a) nor (b) is true.
-----------------------------------------------------------------------------------
. Consider the code segment below.
if ( gender == 1 )
if ( age >= 65 )
++seniorFemales;
This segment is equivalent to which of the following ( circle all that apply, or none )?
a. if ( gender == 1 || age >= 65 )
++seniorFemales;
b. if ( gender == 1 && age >= 65 )
++seniorFemales;
c. if ( gender == 1 AND age >= 65 )
++seniorFemales;
d. if ( gender == 1 OR age >= 65 )
++seniorFemales;
----------------------------------------------------------------------------------------------------
Consider the following Java statements:
int x = 9;
double y = 5.3;
result = calculateValue( x, y );
Which of the following statements is true ( circle all that apply, or none )?
A. The method call operator is ().
B x and y are parameters.
C. Copies of x and y are passed to the method calculateValue().
D. x and y are arguments.
a. None of the statements are true.
b. B and D are true.
c. B is false.
d. All of the statements are true.