Felanpro

uppgift89

Nov 19th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package skola;
  7.  
  8. /**
  9. *
  10. * @author Felix 1
  11. */
  12. public class Uppgift89 {
  13.  
  14. /**
  15. * @param args the command line arguments
  16. */
  17. public static void main(String[] args) {
  18. double behållning = 1000;
  19. int år = 0;
  20.  
  21. while(behållning < 100000)
  22. {
  23. behållning *= 1.05;
  24. behållning += 1000;
  25. år++;
  26. }
  27.  
  28. behållning += 1000;
  29.  
  30. System.out.println(behållning);
  31. System.out.println(år);
  32. }
  33.  
  34. }
  35.  
Add Comment
Please, Sign In to add comment