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/Arithmetik.java | |
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/Arithmetik.java')
-rw-r--r-- | ws2015/EiP/blaetter/02/Arithmetik.java | 33 |
1 files changed, 0 insertions, 33 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 | } | ||