Grossmacher erledigt

master
2210806 2023-03-23 01:59:03 +01:00
parent 2e49752489
commit fe80c02418
1 changed files with 20 additions and 2 deletions

View File

@ -1,6 +1,24 @@
package pr2.auffrischung.grossmacher; package main.java.pr2.auffrischung.grossmacher;
public class 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
} }