浏览代码

NaiveTicket

NiraParikh 6 年前
父节点
当前提交
cc432c7f35
共有 4 个文件被更改,包括 38 次插入37 次删除
  1. 二进制
      .DS_Store
  2. 4
    3
      TicketMachine.java
  3. 17
    17
      bluej.pkg
  4. 17
    17
      package.bluej

二进制
.DS_Store 查看文件


+ 4
- 3
TicketMachine.java 查看文件

@@ -1,3 +1,5 @@
1
+ 
2
+
1 3
 /**
2 4
  * TicketMachine models a naive ticket machine that issues
3 5
  * flat-fare tickets.
@@ -9,7 +11,7 @@
9 11
  * @author David J. Barnes and Michael Kolling
10 12
  * @version 2008.03.30
11 13
  */
12
-public class TicketMachine
14
+ public class TicketMachine
13 15
 {
14 16
     // The price of a ticket from this machine.
15 17
     private int price;
@@ -17,7 +19,6 @@ public class TicketMachine
17 19
     private int balance;
18 20
     // The total amount of money collected by this machine.
19 21
     private int total;
20
-
21 22
     /**
22 23
      * Create a machine that issues tickets of the given price.
23 24
      * Note that the price must be greater than zero, and there
@@ -26,7 +27,7 @@ public class TicketMachine
26 27
     public TicketMachine(int ticketCost)
27 28
     {
28 29
         price = ticketCost;
29
-        balance = 0;
30
+        balance = 10;
30 31
         total = 0;
31 32
     }
32 33
 

+ 17
- 17
bluej.pkg 查看文件

@@ -1,18 +1,18 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=722
3
-editor.fx.0.width=800
4
-editor.fx.0.x=709
5
-editor.fx.0.y=113
6
-objectbench.height=101
7
-objectbench.width=461
8
-package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
11
-package.editor.width=674
12
-package.editor.x=1067
13
-package.editor.y=119
14
-package.frame.height=600
15
-package.frame.width=800
2
+editor.fx.0.height=0
3
+editor.fx.0.width=0
4
+editor.fx.0.x=0
5
+editor.fx.0.y=0
6
+objectbench.height=258
7
+objectbench.width=348
8
+package.divider.horizontal=0.5996621621621622
9
+package.divider.vertical=0.5929339477726574
10
+package.editor.height=379
11
+package.editor.width=486
12
+package.editor.x=208
13
+package.editor.y=233
14
+package.frame.height=709
15
+package.frame.width=612
16 16
 package.numDependencies=0
17 17
 package.numTargets=1
18 18
 package.showExtends=true
@@ -23,10 +23,10 @@ readme.name=@README
23 23
 readme.width=47
24 24
 readme.x=10
25 25
 readme.y=10
26
-target1.height=50
26
+target1.height=90
27 27
 target1.name=TicketMachine
28 28
 target1.showInterface=false
29 29
 target1.type=ClassTarget
30
-target1.width=120
31
-target1.x=80
30
+target1.width=180
31
+target1.x=110
32 32
 target1.y=50

+ 17
- 17
package.bluej 查看文件

@@ -1,18 +1,18 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=722
3
-editor.fx.0.width=800
4
-editor.fx.0.x=709
5
-editor.fx.0.y=113
6
-objectbench.height=101
7
-objectbench.width=461
8
-package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
11
-package.editor.width=674
12
-package.editor.x=1067
13
-package.editor.y=119
14
-package.frame.height=600
15
-package.frame.width=800
2
+editor.fx.0.height=0
3
+editor.fx.0.width=0
4
+editor.fx.0.x=0
5
+editor.fx.0.y=0
6
+objectbench.height=258
7
+objectbench.width=348
8
+package.divider.horizontal=0.5996621621621622
9
+package.divider.vertical=0.5929339477726574
10
+package.editor.height=379
11
+package.editor.width=486
12
+package.editor.x=208
13
+package.editor.y=233
14
+package.frame.height=709
15
+package.frame.width=612
16 16
 package.numDependencies=0
17 17
 package.numTargets=1
18 18
 package.showExtends=true
@@ -23,10 +23,10 @@ readme.name=@README
23 23
 readme.width=47
24 24
 readme.x=10
25 25
 readme.y=10
26
-target1.height=50
26
+target1.height=90
27 27
 target1.name=TicketMachine
28 28
 target1.showInterface=false
29 29
 target1.type=ClassTarget
30
-target1.width=120
31
-target1.x=80
30
+target1.width=180
31
+target1.x=110
32 32
 target1.y=50