Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Programmkopf Anfang
- * Name: Tim Breitfeld
- * Klasse: FS61
- * Programmname: Sparkonto
- * Beschreibung: Eingabe von n, Ausgabe der Zahlen von 0 bis n untereinander
- * Version 1.0 vom 20.01.2016
- Programmkopf Ende**/
- public class Aufgabe7_Sparkonto {
- // HT Anfang
- public static void main(String[] args) {
- // DK Anfang
- double kontostand = 0, monatsrate = 100, sparziel = 262000, zinssatzJ = 0, zinssatzM = 0;
- int monat = 0, jahr = 0;
- // DK Ende
- sparziel = InOut.readDouble("Bitte geben Sie ihr Sparziel ein: ");
- monatsrate = InOut.readDouble("Bitte geben Sie ihre Monatsrate ein: ");
- zinssatzJ = InOut.readDouble("Bitte geben Sie die Verzinsung ein: ");
- zinssatzM = zinssatzJ / 12;
- System.out.println(" Jahr Monat Kontostand ");
- for ( kontostand = 0; kontostand <= sparziel; kontostand = kontostand + monatsrate ) {
- System.out.printf("\n " + jahr + " " + monat + " %10.2f", kontostand);
- monat = monat + 1;
- jahr = monat / 12;
- kontostand = kontostand + (kontostand * zinssatzM);
- } // end of for
- } // HT Ende
- } // end of class Zahlenausgabe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement