commit 08d40b624198e3eca53fb0d32cee1f7eb6a4ad0e Author: cediackermann Date: Tue Apr 21 11:17:54 2026 +0200 init diff --git a/01/Eins.java b/01/Eins.java new file mode 100644 index 0000000..63c8152 --- /dev/null +++ b/01/Eins.java @@ -0,0 +1,23 @@ +public class Eins { + + public static void main(String[] args) { + System.out.println(calculateScore("imperative") == 9); + System.out.println(calculateScore("no") == 2); + System.out.println(wordScore("declarative") == 9); + System.out.println(wordScore("yes") == 3); + } + + public static int calculateScore(String word) { + int score = 0; + for (char c : word.toCharArray()) { + if (c != 'a') { + score++; + } + } + return score; + } + + public static int wordScore(String word) { + return word.replace("a", "").length(); + } +} diff --git a/01/ShoppingCart.java b/01/ShoppingCart.java new file mode 100644 index 0000000..bd815d1 --- /dev/null +++ b/01/ShoppingCart.java @@ -0,0 +1,10 @@ +import java.util.ArrayList; +import java.util.List; + +public class ShoppingCart { + + private List items = new ArrayList(); + private boolean bookAdded; + + public static void main(String[] args) {} +} diff --git a/bin/Main.class b/bin/Main.class new file mode 100644 index 0000000..caaad96 Binary files /dev/null and b/bin/Main.class differ