diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-10-31 01:15:59 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-10-31 01:15:59 +0100 |
commit | 4e85d3d65769851e52b03cdaf4df8c210e621246 (patch) | |
tree | c75ea87ac3f5d7e43cebf0eba8486e081d08851c /ws2015/einfuehrung_in_die_programmierung/blaetter/02/Arithmetik.java | |
parent | b91812f31131580b751f610164f9c3d24b7c5eaa (diff) | |
download | uni-4e85d3d65769851e52b03cdaf4df8c210e621246.tar uni-4e85d3d65769851e52b03cdaf4df8c210e621246.tar.gz uni-4e85d3d65769851e52b03cdaf4df8c210e621246.tar.bz2 uni-4e85d3d65769851e52b03cdaf4df8c210e621246.tar.xz uni-4e85d3d65769851e52b03cdaf4df8c210e621246.zip |
shortened filenames
Diffstat (limited to 'ws2015/einfuehrung_in_die_programmierung/blaetter/02/Arithmetik.java')
-rw-r--r-- | ws2015/einfuehrung_in_die_programmierung/blaetter/02/Arithmetik.java | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/ws2015/einfuehrung_in_die_programmierung/blaetter/02/Arithmetik.java b/ws2015/einfuehrung_in_die_programmierung/blaetter/02/Arithmetik.java deleted file mode 100644 index 90335a4..0000000 --- a/ws2015/einfuehrung_in_die_programmierung/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 | } | ||