|
@@ -0,0 +1,29 @@
|
|
1
|
+package io.zipcoder.casino;
|
|
2
|
+
|
|
3
|
+import java.util.Scanner;
|
|
4
|
+
|
|
5
|
+public class Console {
|
|
6
|
+ public static int numberFromString(String str) {
|
|
7
|
+ return Integer.parseInt(str);
|
|
8
|
+ }
|
|
9
|
+
|
|
10
|
+ public static String stringFromNumber(int num) {
|
|
11
|
+ return Integer.toString(num);
|
|
12
|
+ }
|
|
13
|
+
|
|
14
|
+ public static String askForInput(String thingToAsk) {
|
|
15
|
+ System.out.println(thingToAsk);
|
|
16
|
+ Scanner scan = new Scanner(System.in);
|
|
17
|
+ return scan.nextLine();
|
|
18
|
+ }
|
|
19
|
+
|
|
20
|
+ public static String output(String output) {
|
|
21
|
+ System.out.println(output);
|
|
22
|
+ return output;
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ public static String output(int output) {
|
|
26
|
+ System.out.println(stringFromNumber(output));
|
|
27
|
+ return stringFromNumber(output);
|
|
28
|
+ }
|
|
29
|
+}
|