Programmiertechnik_I/Aufgabe6.java
// initialize a function that prints the given number as word strings
initialize a function that prints the given number as word strings
initialize a function that prints the given number as word strings
public void print6(int number) {
    String[] words = { "null", "eins", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun" };
    ArrayList<String> finished = new ArrayList<String>();
    while (number > 0) {
      String word = words[number % 10];
      finished.add(word);
      number /= 10;
    }
    Collections.reverse(finished);
    System.out.println(finished);
  }
public void print6 ( int number ) { String [ ] words = { "null" , "eins" , "zwei" , "drei" , "vier" , "fünf", sechs", sieben", acht", neun"  ; ArrayList < String > finished = new ArrayList < String > ( ) ; while ( number > 0 ) { String word = words [ number % 10 ] ; finished . add ( word ) ; number /= 10 ; } Collections . reverse ( finished ) ; System . out . println ( finished ) ; }
initialize a function that prints the given number as word strings
initialize a function that prints the given number as word strings
// not necessary, alternatively print word inside while loop