Which three, inserted independently at line 10, produce the output Good afternoon?

Given:
6. int time = 12;
7. if ( time < 12 ) {
8. System.out.println(“Good morning”);
9. }
10. // insert code here
11. System.out.println(“Good afternoon”);
12. }
13. else if ( time >= 18 ) {
14. System.out.println(“Good evening”);
15. }
Which three, inserted independently at line 10, produce the output Good afternoon? (Choose
three.)

Given:
6. int time = 12;
7. if ( time < 12 ) {
8. System.out.println(“Good morning”);
9. }
10. // insert code here
11. System.out.println(“Good afternoon”);
12. }
13. else if ( time >= 18 ) {
14. System.out.println(“Good evening”);
15. }
Which three, inserted independently at line 10, produce the output Good afternoon? (Choose
three.)

A.
else if ( time > 12 || time <= 18 ) {

B.
else if ( time > 12 && time >= 18 ) {

C.
if ( time >= 12 && time < 18 ) {

D.
else if ( time >= 12 || time < 18 ) {

E.
else if ( time < 12 || time > 18) {



Leave a Reply 0

Your email address will not be published. Required fields are marked *