-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOToolsDemo.java
More file actions
35 lines (30 loc) · 943 Bytes
/
Copy pathIOToolsDemo.java
File metadata and controls
35 lines (30 loc) · 943 Bytes
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
26
27
28
29
30
31
32
33
34
35
/*
* "Grundkurs Programmieren in Java"
* 2001-2018, Carl Hanser Verlag
* Demo-programm zu den IOTools (Version 2018 ff)
* (c) 2018 D. Ratz
*
*/
import Prog1Tools.IOTools;
public class IOToolsDemo {
public static void main (String[] args) {
// int-Eingabe mit separatem Prompt
System.out.print("i = ");
int i = IOTools.readInt();
// Vereinfachte int-Eingabe mit Prompt
int k = IOTools.readInt("k = ");
// double-Eingabe mit Prompt
double d = IOTools.readDouble("d = ");
// char-Eingabe mit Prompt
char c = IOTools.readChar("c = ");
// boolean-Eingabe mit Prompt
boolean b = IOTools.readBoolean("b = ");
// Testausgaben
System.out.println("Eingelesene Werte");
System.out.println("i = " + i);
System.out.println("k = " + k);
System.out.println("d = " + d);
System.out.println("c = " + c);
System.out.println("b = " + b);
}
}