better variable naming

This commit is contained in:
fabianArbeit 2025-04-16 10:30:08 +02:00
parent f264a67915
commit 44d981d845

View File

@ -167,34 +167,34 @@ class Darlehenberechner {
DECIMAL_FORMAT.setParseBigDecimal(true); DECIMAL_FORMAT.setParseBigDecimal(true);
var konfig = new Konfiguration(); var konfig = new Konfiguration();
var dis = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); var br = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
System.out.print("Darlehenswert: "); System.out.print("Darlehenswert: ");
konfig.setDarlehenswert((BigDecimal) DECIMAL_FORMAT.parse(dis.readLine())); konfig.setDarlehenswert((BigDecimal) DECIMAL_FORMAT.parse(br.readLine()));
System.out.print("Zinssatz: "); System.out.print("Zinssatz: ");
konfig.setZinssatzProzent((BigDecimal) DECIMAL_FORMAT.parse(dis.readLine())); konfig.setZinssatzProzent((BigDecimal) DECIMAL_FORMAT.parse(br.readLine()));
System.out.print("Monatliche Rate: "); System.out.print("Monatliche Rate: ");
konfig.setMonatlicheRate((BigDecimal) DECIMAL_FORMAT.parse(dis.readLine())); konfig.setMonatlicheRate((BigDecimal) DECIMAL_FORMAT.parse(br.readLine()));
System.out.print("Monat erste Rate(z.B. 2007-12): "); System.out.print("Monat erste Rate(z.B. 2007-12): ");
konfig.setAnfangsmonat(YearMonth.parse(dis.readLine())); konfig.setAnfangsmonat(YearMonth.parse(br.readLine()));
System.out.print("Laufzeit in Jahren(optional Jahre:Monate): "); System.out.print("Laufzeit in Jahren(optional Jahre:Monate): ");
String in = dis.readLine(); String in = br.readLine();
if (in != null && !in.isBlank()) { if (in != null && !in.isBlank()) {
String[] split = in.split(":"); String[] split = in.split(":");
konfig.setLaufzeit(Integer.parseInt(split[0]), Integer.parseInt(split[1])); konfig.setLaufzeit(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
} else { } else {
System.out.print("Restschuld(optional): "); System.out.print("Restschuld(optional): ");
in = dis.readLine(); in = br.readLine();
if (in != null && !in.isBlank()) { if (in != null && !in.isBlank()) {
konfig.setRestschuld((BigDecimal) DECIMAL_FORMAT.parse(in)); konfig.setRestschuld((BigDecimal) DECIMAL_FORMAT.parse(in));
} }
} }
System.out.print("Anzahl tilgungsfreier Monate(optional): "); System.out.print("Anzahl tilgungsfreier Monate(optional): ");
in = dis.readLine(); in = br.readLine();
if (in != null && !in.isBlank()) { if (in != null && !in.isBlank()) {
konfig.setTilgungsfreieZeit(Integer.parseInt(in)); konfig.setTilgungsfreieZeit(Integer.parseInt(in));
} }
System.out.print("Sondertilgungssatz(optional): "); System.out.print("Sondertilgungssatz(optional): ");
in = dis.readLine(); in = br.readLine();
if (in != null && !in.isBlank()) { if (in != null && !in.isBlank()) {
konfig.setSondertilgungProzent((BigDecimal) DECIMAL_FORMAT.parse(in)); konfig.setSondertilgungProzent((BigDecimal) DECIMAL_FORMAT.parse(in));
} }