瀏覽代碼

Created a new Player

Akeem Cherry 6 年之前
父節點
當前提交
5908005c46
共有 2 個檔案被更改,包括 20 行新增0 行删除
  1. 18
    0
      src/main/java/io/zipcoder/casino/Casino.java
  2. 2
    0
      src/test/java/io/zipcoder/casino/CasinoTest.java

+ 18
- 0
src/main/java/io/zipcoder/casino/Casino.java 查看文件

@@ -1,5 +1,23 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 
4
+import java.util.Scanner;
5
+
4 6
 public class Casino {
7
+
8
+
9
+    public static void main(String[] args){
10
+        Player player = createPlayer();
11
+
12
+    }
13
+
14
+    public static Player createPlayer(){
15
+        System.out.println("What is your name player?");
16
+        Scanner playerInput = new Scanner(System.in);
17
+        String playerName = playerInput.nextLine();
18
+        System.out.println("How much money do you have?");
19
+        double startingMoney = playerInput.nextDouble();
20
+        //System.out.println(playerName + ": " + startingMoney);
21
+        return new Player(playerName, startingMoney);
22
+    }
5 23
 }

+ 2
- 0
src/test/java/io/zipcoder/casino/CasinoTest.java 查看文件

@@ -2,4 +2,6 @@ package io.zipcoder.casino;
2 2
 
3 3
 
4 4
 public class CasinoTest {
5
+
6
+
5 7
 }