Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. /*Trey Darling
  2. * 9/9/2019
  3. * Intro to Java CSC-111
  4. * CSC-111 Homework 1
  5. * Write a program to display how the Population changes yearly without using Variables or Loops
  6. * tjdarling0001@student.stcc.edu
  7. */
  8. public class Population {
  9.  
  10. public static void main(String[] args) {
  11. System.out.println("Initial Population: " + 312032486);
  12.  
  13. System.out.print("Population After One Year: ");
  14. System.out.println(
  15. 312032486 + ((365 * 24 * 60 * 60) / 7) - ((365 * 24 * 60 * 60) / 13) + ((365 * 24 * 60 * 60) / 45));
  16.  
  17. System.out.print("Population After Two Years: ");
  18. System.out.println(
  19. 314812582 + ((365 * 24 * 60 * 60) / 7) - ((365 * 24 * 60 * 60) / 13) + ((365 * 24 * 60 * 60) / 45));
  20.  
  21. System.out.print("Population After Three Years: ");
  22. System.out.println(
  23. 317592678 + ((365 * 24 * 60 * 60) / 7) - ((365 * 24 * 60 * 60) / 13) + ((365 * 24 * 60 * 60) / 45));
  24.  
  25. System.out.print("Population After Four Years: ");
  26. System.out.println(
  27. 320372774 + ((365 * 24 * 60 * 60) / 7) - ((365 * 24 * 60 * 60) / 13) + ((365 * 24 * 60 * 60) / 45));
  28.  
  29. System.out.print("Population After Five Years: ");
  30. System.out.println(
  31. 323152870 + ((365 * 24 * 60 * 60) / 7) - ((365 * 24 * 60 * 60) / 13) + ((365 * 24 * 60 * 60) / 45));
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement