Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. package woche2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Übung3Zins3 {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. int kapital;
  10. double zinssatz;
  11. int laufzeit;
  12. Scanner s = new Scanner(System.in);
  13.  
  14. System.out.print("Kapitalwert?: ");
  15. kapital = s.nextInt();
  16. System.out.print("Zinssatz?: ");
  17. zinssatz = s.nextDouble();
  18. System.out.print("Laufzeit?: ");
  19. laufzeit = s.nextInt();
  20. s.close();
  21.  
  22. for (int t=1; t <= laufzeit; t++) {
  23.  
  24. double endkapital = kapital*Math.pow(1+(zinssatz /100),t);
  25. System.out.println(t + " .Jahr: " + endkapital + "€");
  26. }
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement