From 47139d08a1e6fd2a3119302d6520a78c32895356 Mon Sep 17 00:00:00 2001 From: jannisfingerhut Date: Fri, 10 Feb 2023 02:22:37 +0100 Subject: [PATCH] Funktion SchaltjahrBerechnung erstellt --- LernProgramm/ProgrammMain.java | 24 ++++++++++++++++++++++++ bin/LernProgramm/ProgrammMain.class | Bin 6175 -> 1184 bytes 2 files changed, 24 insertions(+) diff --git a/LernProgramm/ProgrammMain.java b/LernProgramm/ProgrammMain.java index 3010513..778446c 100644 --- a/LernProgramm/ProgrammMain.java +++ b/LernProgramm/ProgrammMain.java @@ -153,7 +153,31 @@ public class ProgrammMain { } return binary; } + + + + public static void schaltjahr() { + + System.out.println("Welches Jahr möchtest du untersuchen?"); + + Scanner scanner2 = new Scanner(System.in); + + String jahr = scanner2.nextLine(); + int jahr1 = Integer.parseInt(jahr); + +// Bestimmen+Ausgabe + + if( jahr1 % 400 == 0 ) System.out.println("Schaltjahr!"); + else if( jahr1 % 100 == 0 ) System.out.println("Kein Schaltjahr!"); + else if( jahr1 % 4 == 0 ) System.out.println("Schaltjahr!"); + else System.out.println("Kein Schaltjahr!"); + + } + + + +} public static void main(String[] args) { diff --git a/bin/LernProgramm/ProgrammMain.class b/bin/LernProgramm/ProgrammMain.class index aead564921cd33788617404a8132a9d2a3079f2e..91962de923ae7222f94ca26a42c41aaa66d52c70 100644 GIT binary patch literal 1184 zcmb7?-%b-j6vn@)Ep3-#p$dxlXQ^Injj@<`C58)7lg3prtt9HzbUSIM?9PzsmRJ(6 zd;?#=m(ZAKBKJO&@k|SJ6N=iKlR2~JcjkQGo?pMe{{*msJ6WU{mVIH=j?rzyqo{gv zc)_L0BF!-0$=#lH>>jM?@_pY#vOP^xBCzMB3L?~k6#vR!k zT{{kPm@6QIiwujNKYp?v8>!mscBG;&m3Y~Yn!+?Vy~0rPb-=@2ZlukRFVnUy!-{{d z1?voj=iJ0X?%AkvSY%lJry_>TtG+xuWN>zjj5cNO!P*+b+@@5VREnUZgki|jNI{?c zpaH!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