Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 325
  • Between which two lines should you insert a break or a contin...

Between which two lines should you insert a break or a continue statement to print the message "Please close the door. I feel a draft. Thank you"? (Line numbers are included only for clarity's sake) 1. String door="open"; 2. boolean draft=false; 3. boolean shivers=false; 4. while (door=="open") { 5. draft=true; 6. System.out.println("Please close the door."); 7. if (draft) { 8. shivers=true; 9. System.out.println("I feel a draft."); 10. door="close"; 11. if (shivers) { 12. System.out.println("I'm shivering."); 13. } 14. } 15. } 16. if (door=="close") { 17. System.out.println("Thank you"); 18. shivers=false; 19. }

technology programming languages
    1. Replace lines 7 to 14 with a break statement.
    1. Replace lines 7 to 14 with a continue statement.
    1. Replace line 12 with a continue statement.
    1. Insert a break statement between lines 16 and 17.

Show answer
Correct Option: C

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy