Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication6
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Deklaration und initalisierung von Variablen
- double startkapital = 0, zinssatz = 0, endkaptial = 0, temp = 0;
- //Eingabe von "startkapital"
- Console.WriteLine("Geben sie das Startkapital ein");
- startkapital = Convert.ToDouble(Console.ReadLine());
- //Eingabe von "zinssatz"
- Console.WriteLine("Gebe den Zinssatz ein");
- zinssatz = Convert.ToDouble(Console.ReadLine());
- //Berechnung des Endkapitals(Zinseszins rechnung)
- temp = startkapital;
- temp = temp + temp * (zinssatz / 100);
- temp = temp + temp * (zinssatz / 100);
- temp = temp + temp * (zinssatz / 100);
- endkaptial = temp;
- //Ausgabe des Endkapitals
- Console.WriteLine("Du hast nach 3 Jahren bei " + startkapital + "Euro Startkapital und " + zinssatz + "% Zinssatz : " + endkaptial + "Euro Endkaptial");
- //Konsole offen halten
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement