Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2. namespace ConsoleApplication6
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. //Deklaration und initalisierung von Variablen
  9. double startkapital = 0, zinssatz = 0, endkaptial = 0, temp = 0;
  10. //Eingabe von "startkapital"
  11. Console.WriteLine("Geben sie das Startkapital ein");
  12. startkapital = Convert.ToDouble(Console.ReadLine());
  13. //Eingabe von "zinssatz"
  14. Console.WriteLine("Gebe den Zinssatz ein");
  15. zinssatz = Convert.ToDouble(Console.ReadLine());
  16. //Berechnung des Endkapitals(Zinseszins rechnung)
  17. temp = startkapital;
  18. temp = temp + temp * (zinssatz / 100);
  19. temp = temp + temp * (zinssatz / 100);
  20. temp = temp + temp * (zinssatz / 100);
  21. endkaptial = temp;
  22. //Ausgabe des Endkapitals
  23. Console.WriteLine("Du hast nach 3 Jahren bei " + startkapital + "Euro Startkapital und " + zinssatz + "% Zinssatz : " + endkaptial + "Euro Endkaptial");
  24. //Konsole offen halten
  25. Console.ReadKey();
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement