Grossmacher erledigt
parent
2e49752489
commit
fe80c02418
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue