1 / 17

Java Programming – Solutions for Exercises (Liang, 13th Edition)

Get clear, step-by-step solutions for Java programming tasks from Liangu2019s latest edition. Valuable for exam prep and assignments. Contact info available in document.

Nazri
Télécharger la présentation

Java Programming – Solutions for Exercises (Liang, 13th Edition)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. You can access com pl ete docum ent on f ol l ow i ng U RL. Contact m e i f si te not l oaded ???????????????????????????????????????????????????????????????????????? smtb98@gmail.com ??????????????????????????????????????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????????????????????????? This sample is a converted PDF from .java files of "Solution Manual for Introduction to Java Programming and Data Structures, 13th edition by Y Daniel Liang". You can see sample solutions of exercises in .java and .class format on the site. Table of Contents Exercise01_01 Exercise01_01Extra Exercise01_02 Exercise01_02Extra Exercise01_03 Exercise01_03Extra Exercise01_04 Exercise01_05 Exercise01_06 Exercise01_07 Exercise01_08 Exercise01_09 Exercise01_10 Exercise01_11 Exercise01_12 Exercise01_13 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

  2. Exercise01_01 public class Exercise01_01 { public static void main(String[] args) { System.out.println("Welcome to Java"); System.out.println("Welcome to Computer Science"); System.out.println("Programming is fun"); } }

  3. Exercise01_01 Extra public class Exercise01_01Extra { public static void main(String[] args) { System.out.println(4 * 4 - 4 * 3 * 5); } }

  4. Exercise01_02 public class Exercise01_02 { public static void main(String[] args) { System.out.println("Welcome to Java"); System.out.println("Welcome to Java"); System.out.println("Welcome to Java"); System.out.println("Welcome to Java"); System.out.println("Welcome to Java"); } }

  5. Exercise01_02 Extra public class Exercise01_02Extra { public static void main(String[] args) { System.out.println((10.5 - 5.6) / 0.5); } }

  6. Exercise01_03 public class Exercise01_03 { public static void main(String[] args) { System.out.println(" J A V V A "); System.out.println(" J A A V V A A "); System.out.println("J J AAAAA V V AAAAA "); System.out.println(" J J A A V A A "); } }

  7. Exercise01_03 Extra public class Exercise01_03Extra { public static void main(String[] args) { System.out.println("* ***** *****"); System.out.println("* * * * *"); System.out.println("* * * * *"); System.out.println("* * * * *"); System.out.println("* ***** *****"); } }

  8. Exercise01_04 public class Exercise01_04 { public static void main(String[] args) { System.out.println("a a^2 a^3"); System.out.println("1 1 1"); System.out.println("2 4 8"); System.out.println("3 9 27"); System.out.println("4 16 64"); } }

  9. Exercise01_05 public class Exercise01_05 { public static void main(String[] args) { System.out.println((9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5)); } }

  10. Exercise01_06 public class Exercise01_06 { public static void main(String[] args) { System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9); } }

  11. Exercise01_07 public class Exercise01_07 { public static void main(String[] args) { System.out.println(4 * (1 - 1.0 / 3 + 1.0 / 5 - 1.0 / 7 + 1.0 / 9 - 1.0 / 11)); System.out.println(4 * (1 - 1.0 / 3 + 1.0 / 5 - 1.0 / 7 + 1.0 / 9 - 1.0 / 11 + 1.0 / 13)); } }

  12. Exercise01_08 public class Exercise01_08 { public static void main(String[] args) { // Display area System.out.println(5.5 * 5.5 * 3.14159); // Display perimeter System.out.println(2 * 5.5 * 3.14159); } }

  13. Exercise01_09 public class Exercise01_09 { public static void main(String[] args) { // Display area System.out.println(4.5 * 7.9); // Display perimeter System.out.println(2 * (4.5 + 7.9)); } }

  14. Exercise01_10 public class Exercise01_10 { public static void main(String[] args) { System.out.println((14 / 45.5) * 60 / 1.6); } }

  15. Exercise01_11 public class Exercise01_11 { public static void main(String[] args) { System.out.print("Population after 1 year: "); System.out.println(312032486 + 365 * 24 * 60 * 60 / 7.0 - 365 * 24 * 60 * 60 / 13.0 + 365 * 24 * 60 * 60 / 45.0); System.out.print("Population after 2 years: "); System.out.println(312032486 + 2 * 365 * 24 * 60 * 60 / 7.0 - 2 * 365 * 24 * 60 * 60 / 13.0 + 2 * 365 * 24 * 60 * 60 / 45.0); System.out.print("Population after 3 years: "); System.out.println(312032486 + 3 * 365 * 24 * 60 * 60 / 7.0 - 3 * 365 * 24 * 60 * 60 / 13.0 + 3 * 365 * 24 * 60 * 60 / 45.0); System.out.print("Population after 4 years: "); System.out.println(312032486 + 4 * 365 * 24 * 60 * 60 / 7.0 - 4 * 365 * 24 * 60 * 60 / 13.0 + 4 * 365 * 24 * 60 * 60 / 45.0); System.out.print("Population after 5 years: "); System.out.println(312032486 + 5 * 365 * 24 * 60 * 60 / 7.0 - 5 * 365 * 24 * 60 * 60 / 13.0 + 5 * 365 * 24 * 60 * 60 / 45.0); } }

  16. Exercise01_12 public class Exercise01_12 { public static void main(String[] args) { System.out.println(24 / (1 + (40 + 35.0 / 60) / 60) * 1.6); } }

  17. Exercise01_13 public class Exercise01_13 { public static void main(String[] args) { System.out.println("x is "); System.out.println((44.5 * 0.55 - 50.2 * 5.9) / (3.4 * 0.55 - 50.2 * 2.1)); System.out.println("y is "); System.out.println((3.4 * 5.9 - 44.5 * 2.1) / (3.4 * 0.55 - 50.2 * 2.1)); } }

More Related