Skip to Content
Java How to Program, Early Objects, 11th Edition
book

Java How to Program, Early Objects, 11th Edition

by Paul J. Deitel, Harvey Deitel
June 2017
Beginner
1296 pages
69h 23m
English
Pearson
Content preview from Java How to Program, Early Objects, 11th Edition

Exercises

  1. 5.5 Describe the four basic elements of counter-controlled iteration.

  2. 5.6 Compare and contrast the while and for iteration statements.

  3. 5.7 Discuss a situation in which it would be more appropriate to use a dowhile statement than a while statement. Explain why.

  4. 5.8 Compare and contrast the break and continue statements.

  5. 5.9 Find and correct the error(s) in each of the following segments of code:

    1. 1 For (i = 100, i >= 1, i++) {
      2    System.out.println(i);
      3 }
      
    2. The following code should print whether integer value is odd or even:

      1 switch (value % 2) {
      2   case 0:
      3     System.out.println("Even integer");
      4   case 1:
      5     System.out.println("Odd integer");
      6 }
      
    3. The following code should output the odd integers from 19 to 1:

      1 for (i = 19
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17

Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17

Kishori Sharan, Adam L. Davis
Learning Java, 5th Edition

Learning Java, 5th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck
Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan

Publisher Resources

ISBN: 9780134751962