diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-13 23:45:26 +0000 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-13 23:45:26 +0000 |
| commit | ab9484b343abd995cba915bb0ba4be8907dfa6ec (patch) | |
| tree | f441968094bec070499d24e45e8a29f1315da1f4 /ws2015/EiP/blaetter/02 | |
| parent | 14dc76bda755c850f859a4b974c793e694f2b0b4 (diff) | |
| download | uni-ab9484b343abd995cba915bb0ba4be8907dfa6ec.tar uni-ab9484b343abd995cba915bb0ba4be8907dfa6ec.tar.gz uni-ab9484b343abd995cba915bb0ba4be8907dfa6ec.tar.bz2 uni-ab9484b343abd995cba915bb0ba4be8907dfa6ec.tar.xz uni-ab9484b343abd995cba915bb0ba4be8907dfa6ec.zip | |
Shorter lecture names
Diffstat (limited to 'ws2015/EiP/blaetter/02')
| -rw-r--r-- | ws2015/EiP/blaetter/02/Arithmetik.java | 33 | ||||
| -rw-r--r-- | ws2015/EiP/blaetter/02/H2-1.md | 18 | ||||
| -rw-r--r-- | ws2015/EiP/blaetter/02/H2-2.md | 13 | ||||
| l--------- | ws2015/EiP/blaetter/02/H2-3.java | 1 | ||||
| -rw-r--r-- | ws2015/EiP/blaetter/02/manifest | 3 | ||||
| -rw-r--r-- | ws2015/EiP/blaetter/02/test.sh | 20 |
6 files changed, 0 insertions, 88 deletions
diff --git a/ws2015/EiP/blaetter/02/Arithmetik.java b/ws2015/EiP/blaetter/02/Arithmetik.java deleted file mode 100644 index 90335a4..0000000 --- a/ws2015/EiP/blaetter/02/Arithmetik.java +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | import java.util.Scanner; | ||
| 2 | |||
| 3 | class Arithmetik | ||
| 4 | { | ||
| 5 | public static void main (String[] args) | ||
| 6 | { | ||
| 7 | Scanner scanner = new Scanner(System.in); | ||
| 8 | |||
| 9 | System.out.print("Vorname: "); | ||
| 10 | String vorname = scanner.nextLine(); | ||
| 11 | System.out.print("Nachname: "); | ||
| 12 | String nachname = scanner.nextLine(); | ||
| 13 | System.out.print("x_1 = "); | ||
| 14 | int x1 = scanner.nextInt(); | ||
| 15 | System.out.print("x_2 = "); | ||
| 16 | int x2 = scanner.nextInt(); | ||
| 17 | |||
| 18 | System.out.print("Hallo " + vorname.substring(0,1) + ". " + nachname + "! "); | ||
| 19 | |||
| 20 | if (x1 < x2) | ||
| 21 | { | ||
| 22 | System.out.println("Der Mittelwert von " + x1 + " und " + x2 + " ist übrigens " + ((x1 + x2) / 2.0) + "!"); | ||
| 23 | } | ||
| 24 | else if (x1 > 0 && x2 > 0) | ||
| 25 | { | ||
| 26 | System.out.println("Der Kehrwert von " + x1 + " ist ungefähr " + 1.0/x1 + "!"); | ||
| 27 | } | ||
| 28 | else | ||
| 29 | { | ||
| 30 | System.out.println(x1 + x2); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | } | ||
diff --git a/ws2015/EiP/blaetter/02/H2-1.md b/ws2015/EiP/blaetter/02/H2-1.md deleted file mode 100644 index e2fa908..0000000 --- a/ws2015/EiP/blaetter/02/H2-1.md +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | # Speicherbild | ||
| 2 | |||
| 3 | Wir notieren eine Referenz mit Variablennamen `x` auf ein Objekt, dessen Repräsentation als String `...` ist, wie folgt: | ||
| 4 | |||
| 5 | ~~~ {.java} | ||
| 6 | x -> ... | ||
| 7 | ~~~ | ||
| 8 | |||
| 9 | ~~~ {.java} | ||
| 10 | Int x = 9 | ||
| 11 | Prof prof1 -> Prof[name="Chris",teaching=9] | ||
| 12 | Prof prof2 -> Prof[name="Dora",teaching=9] | ||
| 13 | Student student1 -> Student[name="Alois",matrikel=1234] | ||
| 14 | Student student2 -> Student[name="Bine",matrikel=4567] | ||
| 15 | Student student3 -> Student[name="Alois",matrikel=1234] | ||
| 16 | ~~~ | ||
| 17 | |||
| 18 | `student1` und `student3` zeigen auf unterschiedliche Speicherbereiche. | ||
diff --git a/ws2015/EiP/blaetter/02/H2-2.md b/ws2015/EiP/blaetter/02/H2-2.md deleted file mode 100644 index 430d28e..0000000 --- a/ws2015/EiP/blaetter/02/H2-2.md +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | # Variablen | ||
| 2 | |||
| 3 | 2 -- `int x` | ||
| 4 | ~ Instanzvariable -- Lebenspanne identisch mit der des Objekts, Sichtbar (und nicht überschattet) in 9, und 13 | ||
| 5 | |||
| 6 | 4 -- `int x` | ||
| 7 | ~ Parameter -- Lebenspanne bis 6, Sichtbar in 5 | ||
| 8 | |||
| 9 | 12 -- `int y` | ||
| 10 | ~ Parameter -- Lebenspanne bis 17, Sichtbar in 13--16 | ||
| 11 | |||
| 12 | 14 -- `int x` | ||
| 13 | ~ Lokale Variable -- Lebenspanne bis 17, Sichtbar in 15--16 | ||
diff --git a/ws2015/EiP/blaetter/02/H2-3.java b/ws2015/EiP/blaetter/02/H2-3.java deleted file mode 120000 index 34aea7f..0000000 --- a/ws2015/EiP/blaetter/02/H2-3.java +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | Arithmetik.java \ No newline at end of file | ||
diff --git a/ws2015/EiP/blaetter/02/manifest b/ws2015/EiP/blaetter/02/manifest deleted file mode 100644 index 9cec2d1..0000000 --- a/ws2015/EiP/blaetter/02/manifest +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | H2-1.pdf | ||
| 2 | H2-2.pdf | ||
| 3 | H2-3.java \ No newline at end of file | ||
diff --git a/ws2015/EiP/blaetter/02/test.sh b/ws2015/EiP/blaetter/02/test.sh deleted file mode 100644 index 5647e13..0000000 --- a/ws2015/EiP/blaetter/02/test.sh +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #!/usr/bin/env zsh | ||
| 2 | |||
| 3 | runTest() { | ||
| 4 | ret=$(echo $1 | java Arithmetik | tail -c +32) | ||
| 5 | if [[ $ret != $2 ]]; then | ||
| 6 | echo "Input:" | ||
| 7 | echo $1 | ||
| 8 | echo "Should return:" | ||
| 9 | echo $2 | ||
| 10 | echo "But returns:" | ||
| 11 | echo $ret | ||
| 12 | exit 1 | ||
| 13 | fi | ||
| 14 | } | ||
| 15 | |||
| 16 | gup --update Arithmetik.class || exit 1 | ||
| 17 | |||
| 18 | runTest "Christian\nElegans\n2\n7" "Hallo C. Elegans! Der Mittelwert von 2 und 7 ist übrigens 4.5!" | ||
| 19 | runTest "Gustav\nEnauer\n70\n15" "Hallo G. Enauer! Der Kehrwert von 70 ist ungefähr 0.014285714285714!" | ||
| 20 | runTest "Karla\nEhr-Wert\n7\n3" "Hallo K. Ehr-Wert! Der Kehrwert von 7 ist ungefähr 0.143!" | ||
