From fe80c02418aa5c0571ad4f0ac2eb8a14e53e89d3 Mon Sep 17 00:00:00 2001 From: 2210806 <118163861+2210806@users.noreply.github.com> Date: Thu, 23 Mar 2023 01:59:03 +0100 Subject: [PATCH] Grossmacher erledigt --- .../auffrischung/grossmacher/Grossmacher.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sources/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java b/sources/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java index 74e6b5c..b273de7 100644 --- a/sources/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java +++ b/sources/src/main/java/pr2/auffrischung/grossmacher/Grossmacher.java @@ -1,6 +1,24 @@ -package pr2.auffrischung.grossmacher; +package main.java.pr2.auffrischung.grossmacher; public class Grossmacher { + public static void main(String[] args) { + + String s = "Hallo, dies ist ein Test"; + char [] chararray = s.toCharArray(); + String output; + + for (int i = 0; i < chararray.length; i++){ + if(chararray[i] >= 'a' && chararray[i] <= 'z'){ + chararray[i] = (char)(chararray[i]-32); + } + } + + output = new String(chararray); + + System.out.println("Eingabe : " + s); + System.out.println("Ergebnis: " + output); + System.out.println("Zeichen : " + s.length()); + + } - // TODO: main-Methode implementieren }