From 8bc1944076f281c45cc85466e3964f7ff9caf986 Mon Sep 17 00:00:00 2001 From: Thomas Smits Date: Tue, 14 Nov 2023 10:50:32 +0100 Subject: [PATCH] Update of exercises --- Assignment_001/readme.md | 2 +- Assignment_001/solution/readme.md | 4 ++++ .../auffrischung/grossmacher/Grossmacher.java | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Assignment_001/solution/readme.md create mode 100644 solutions/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java diff --git a/Assignment_001/readme.md b/Assignment_001/readme.md index dd4461d..212219d 100644 --- a/Assignment_001/readme.md +++ b/Assignment_001/readme.md @@ -1,6 +1,6 @@ # String in Großbuchstaben umwandeln - + [Musterlösung](solution/) ## Lernziel diff --git a/Assignment_001/solution/readme.md b/Assignment_001/solution/readme.md new file mode 100644 index 0000000..98181fa --- /dev/null +++ b/Assignment_001/solution/readme.md @@ -0,0 +1,4 @@ +# Lösung: String in Großbuchstaben umwandeln + + +[pr2.auffrischung.grossmacher](../solutions/src/main/java/pr2/auffrischung/grossmacher) diff --git a/solutions/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java b/solutions/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java new file mode 100644 index 0000000..2ed9101 --- /dev/null +++ b/solutions/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java @@ -0,0 +1,16 @@ +package pr2.auffrischung.grossmacher; + +public class Grossmacher { + + public static void main(String[] args) { + if (args.length < 1) { + System.err.println("Kein Argument angeben!"); + return; + } + + String ergebnis = args[0].toUpperCase(); + + System.out.printf("Ergebnis: %s%n", ergebnis); + System.out.printf("Zeichen : %d%n", ergebnis.length()); + } +}