- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio.java
More file actions
Latest commit
152 lines (136 loc) · 4.07 KB
/
Copy pathio.java
File metadata and controls
152 lines (136 loc) · 4.07 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
importjava.util.Scanner;
publicclassio {
/**
* Prints the given integer value to the console.
*
* @param i_ids The integer value to be printed.
*/
publicstaticvoidprint(inti_ids) {
System.out.print(i_ids);
}
/**
* Prints the given string value to the console.
*
* @param s_names The string value to be printed.
*/
publicstaticvoidprint(Strings_names) {
System.out.print(s_names);
}
/**
* Prints the given float value to the console.
*
* @param f_float The float value to be printed.
*/
publicstaticvoidprint(floatf_float) {
System.out.print(f_float);
}
/**
* Prints the given double value to the console.
*
* @param d_double The double value to be printed.
*/
publicstaticvoidprint(doubled_double) {
System.out.print(d_double);
}
/**
* Prints the given long value to the console.
*
* @param l_long The long value to be printed.
*/
publicstaticvoidprint(longl_long) {
System.out.print(l_long);
}
/**
* Prints the given character value to the console.
*
* @param c_char The character value to be printed.
*/
publicstaticvoidprint(charc_char) {
System.out.print(c_char);
}
/**
* Prints the given boolean value to the console.
*
* @param b_boolean The boolean value to be printed.
*/
publicstaticvoidprint(booleanb_boolean) {
System.out.print(b_boolean);
}
/**
* Prompts the user for an integer value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The integer value entered by the user.
*/
publicstaticintinputI(Stringprompt) {
Scannerscan = newScanner(System.in);
print(prompt);
returnscan.nextInt();
}
/**
* Prompts the user for a string value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The string value entered by the user.
*/
publicstaticStringinputS(Stringprompt) {
Scannerscan = newScanner(System.in);
print(prompt);
returnscan.nextLine();
}
/**
* Prompts the user for a float value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The float value entered by the user.
*/
publicstaticfloatinputF(Stringprompt) {
Scannerscan_float = newScanner(System.in);
print(prompt);
returnscan_float.nextFloat();
}
/**
* Prompts the user for a double value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The double value entered by the user.
*/
publicstaticdoubleinputD(Stringprompt) {
Scannerscan_double = newScanner(System.in);
print(prompt);
returnscan_double.nextDouble();
}
/**
* Prompts the user for a long value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The long value entered by the user.
*/
publicstaticlonginputL(Stringprompt) {
Scannerscan_long = newScanner(System.in);
print(prompt);
returnscan_long.nextLong();
}
/**
* Prompts the user for a long value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The char value entered by the user.
*/
publicstaticcharinputC(Stringprompt){
Scannerscan_char = newScanner(System.in);
print(prompt);
returnscan_char.next().charAt(0);
}
/**
* Prompts the user for a long value and returns it.
*
* @param prompt The message to display to the user before input.
* @return The boolean value entered by the user.
*/
publicstaticbooleaninputB(Stringprompt){
Scannerscan_boll = newScanner(System.in);
print(prompt);
returnscan_boll.nextBoolean();
}
}