The objective of the nested if statement below is: If amount1 is greater than 10 and amount2 is less than 100, display the greater of the two. Complete the incomplete if statement. if (amount1 > 10) { if (amount2 < 100) { if ( ) System.out.println(amount1); else System.out.println(amount2);} } Write your answer as: if(....)

Respuesta :

Answer:

The complete "if statement" is given below;

1st Method:

using if else statement

If (amount1>10 && amount2<100)

{

If(amount1>amount2)

system.out.println(amount1);

}

else

{

system.out.println(amount2);

}

}

2nd Method:

using conditional statement

if(amount1 > 10 && amount2 < 100)

{

   System.out.println(amount1 > amount2 ? amount1 : amount2);

\\conditional statement shows if amount1 is greater than amount2 it means the statement is true so it will show the true value i.e. amount1. But if amount1 is less than amount2 then the statement is false so it will show the false value i.e. amount2

}