Guten Abend,
ich sitze seit paar Stunden an meinen Aufgaben und komme leider nicht weiter. Mein Compiler zeigt mir die ganze Zeit fehler, aber ich kann diese Fehler nicht beheben. Ich hoffe Ihr könnt mir weiterhelfen.
Lg
ich sitze seit paar Stunden an meinen Aufgaben und komme leider nicht weiter. Mein Compiler zeigt mir die ganze Zeit fehler, aber ich kann diese Fehler nicht beheben. Ich hoffe Ihr könnt mir weiterhelfen.
Lg
Java:
import java.util.Arrays;
public class Uebung1 {
// TODO: declare a constant named "FOO_BAR" with a value of -123.456 * 10^(-89)
final static double FOO_BAR = -123.456*10e-89;
public enum Months {
JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER
}
// TODO: declare an enumeration named "Months" containing the
// english names in CAPITAL_LETTERS (!) of all the 12 months of the year
public static char[] someCharacters() {
// TODO: declare, fill and return an 1-dimensional
// array containing the ASCII-letters A to Z (capital letters)
//int [] feld1 = new char [26];
char someCharacters [] = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q',
'R','S','T','U','V','W','X','Y','Z'};
return someCharacters;
}
public static char[][] someMoreCharacters() {
// TODO: declare, fill and return a 2-dimensional array containing
// 1) the values (!) 0 to 25 in the first row,
// 2) the ASCII-letters A to Z (capital letters) in the second row,
// 3) the ASCII-characters (!) 0 to 9, than 0 to 9 again and finally 0 to 5 in the third row
// 4) the ASCII-letters a to z (non-capital letters) in the fourth row,
char someMoreCharacters [][] = { {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},
{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q',
'R','S','T','U','V','W','X','Y','Z'},
{'1','2','3','4','5','6','7','8','9'},
{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
'r','s','t','u','v','w','x','y','z'}};
return someMoreCharacters;
}
// TODO: declare a constant String named "UNICODE" containing the
// greek non-capital alphabet from alpha [03B1] to omega [03C9]
// with a horizontal tabulator between groups of five letters each
// (e.g. after epsilon, after kappa, after omicron and after tau)
// and finally followed by a line feed (ASCII: 0x0A)
// (no spaces or other symbols than those above!!)
char[] c_array = {'\u03B1','\u03B2','\u03B3','\u03B4','\u03B5','\t','\u03B6','\u03B7','\u03B8','\u03B9','\u03BA','\t',
'\u03BB','\u03BC','\u03BD','\u03BE','\u03BF','\t','\u03C0','\u03C1','\u03C2','\u03C3','\u03C4','\t',
'\u03C5','\u03C6','\u03C7','\u03C8','\u03C9','\u000A'};
UNICODE = new String(c_array);
public static int[][][] theCube() {
// TODO: declare, fill and return a 3-dimensional array
// of size 3x3x3 (try to imagine a [url=http://en.wikipedia.org/wiki/Rubik's_Cube]Rubik's Cube - Wikipedia, the free encyclopedia[/url])
// containing only integer numbers such that
// the value at [x][y][z] == (x+1)*100+(y+1)*10+(z+1)
// (e.g. cube[2][1][0] == 321)
//int x;
//int y;
//int z;
//int [x][y][z] theCube =
return null;
}
// nothing to do ;) - please do nothing here:
public static void main(String[] args) {
System.out.println("-----");
System.out.println(Datentypen.FOO_BAR);
System.out.println("-----");
System.out.println(Months.OCTOBER);
System.out.println("-----");
System.out.println(Arrays.toString(someCharacters()));
System.out.println("-----");
for (char[] r : someMoreCharacters()) {
System.out.println(Arrays.toString(r));
}
System.out.println("-----");
System.out.println("[" + Datentypen.UNICODE + "]");
System.out.println("-----");
for (int[][] plane : theCube()) {
for (int[] row : plane) {
System.out.print(Arrays.toString(row));
}
System.out.println();
}
}
}
Zuletzt bearbeitet von einem Moderator: