nafis nibir 8 年 前
コミット
52ab0e423a
共有6 個のファイルを変更した75 個の追加45 個の削除を含む
  1. 18
    19
      DepositAccount.java
  2. 19
    0
      IOboy.java
  3. 0
    0
      READMEEP.txt
  4. 0
    0
      cat.txt
  5. 0
    0
      hello.txt
  6. 38
    26
      package.bluej

+ 18
- 19
DepositAccount.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 class DepositAccount extends Account
2 2
 {
3
- private boolean newmonth=true;
4
- private double interest;
3
+    private boolean newmonth=true;
4
+    private double interest;
5 5
 
6
- public DepositAccount(int sum,double interest)
7
- {
8
-  super(sum);
9
-  this.interest=interest;
10
- }
6
+    public DepositAccount(int sum,double interest)
7
+    {
8
+        super(sum);
9
+        this.interest=interest;
10
+    }
11 11
 
12
- // 
13
- public void withdraw(int sum) throws AccountException
12
+    // 
13
+    public void withdraw(int sum) throws AccountException
14 14
     {
15 15
         if(sum<=super.balance())
16 16
             super.withdraw(sum);
@@ -18,15 +18,14 @@ class DepositAccount extends Account
18 18
             throw new AccountException("overdraw");
19 19
     }
20 20
 
21
+    public void update()
22
+    {
23
+        deposit((int)(balance()*interest));
24
+        newmonth=true;
25
+    }
21 26
 
22
- public void update()
23
- {
24
-  deposit((int)(balance()*interest));
25
-  newmonth=true;
26
- }
27
-
28
- public void setInterest(double newInterest)
29
- {
30
-  interest=newInterest;
31
- }
27
+    public void setInterest(double newInterest)
28
+    {
29
+        interest=newInterest;
30
+    }
32 31
 }

+ 19
- 0
IOboy.java ファイルの表示

@@ -0,0 +1,19 @@
1
+import java.io.*;
2
+public class IOboy 
3
+{
4
+
5
+    private String fileName;
6
+    TextIO test = new TextIO();
7
+    public IOboy() throws IOException {       
8
+        this.fileName = "READMEEP.txt";    
9
+    }
10
+
11
+    public void doIt() throws IOException{
12
+        System.out.println(test.writeDouble(8.0, 5, 2)); 
13
+        test.create(fileName);
14
+        BufferedReader buff = test.open(fileName);
15
+        System.out.println(buff.readLine());     
16
+        System.out.println(test.readString(buff));
17
+    }
18
+
19
+}

+ 0
- 0
READMEEP.txt ファイルの表示


+ 0
- 0
cat.txt ファイルの表示


+ 0
- 0
hello.txt ファイルの表示


+ 38
- 26
package.bluej ファイルの表示

@@ -1,25 +1,37 @@
1 1
 #BlueJ package file
2
-dependency1.from=Account
3
-dependency1.to=AccountException
2
+dependency1.from=Calendar1
3
+dependency1.to=CalendarGraphic
4 4
 dependency1.type=UsesDependency
5
-dependency2.from=DepositAccount
6
-dependency2.to=AccountException
5
+dependency2.from=Calendar1
6
+dependency2.to=DateException
7 7
 dependency2.type=UsesDependency
8
-editor.fx.0.height=722
8
+dependency3.from=Account
9
+dependency3.to=AccountException
10
+dependency3.type=UsesDependency
11
+dependency4.from=Calendar
12
+dependency4.to=DateException
13
+dependency4.type=UsesDependency
14
+dependency5.from=Date
15
+dependency5.to=DateException
16
+dependency5.type=UsesDependency
17
+dependency6.from=DepositAccount
18
+dependency6.to=AccountException
19
+dependency6.type=UsesDependency
20
+editor.fx.0.height=709
9 21
 editor.fx.0.width=800
10 22
 editor.fx.0.x=114
11
-editor.fx.0.y=175
23
+editor.fx.0.y=23
12 24
 objectbench.height=101
13
-objectbench.width=461
25
+objectbench.width=776
14 26
 package.divider.horizontal=0.6
15 27
 package.divider.vertical=0.8007380073800738
16 28
 package.editor.height=427
17 29
 package.editor.width=674
18
-package.editor.x=1006
19
-package.editor.y=133
30
+package.editor.x=480
31
+package.editor.y=132
20 32
 package.frame.height=600
21 33
 package.frame.width=800
22
-package.numDependencies=2
34
+package.numDependencies=6
23 35
 package.numTargets=13
24 36
 package.showExtends=true
25 37
 package.showUses=true
@@ -37,12 +49,12 @@ target1.width=130
37 49
 target1.x=450
38 50
 target1.y=190
39 51
 target10.height=50
40
-target10.name=Scrabble
52
+target10.name=DepositAccount
41 53
 target10.showInterface=false
42 54
 target10.type=ClassTarget
43
-target10.width=80
44
-target10.x=10
45
-target10.y=250
55
+target10.width=120
56
+target10.x=170
57
+target10.y=120
46 58
 target11.height=50
47 59
 target11.name=TriangleTwo
48 60
 target11.showInterface=false
@@ -65,19 +77,19 @@ target13.width=120
65 77
 target13.x=470
66 78
 target13.y=340
67 79
 target2.height=50
68
-target2.name=Account
80
+target2.name=Calendar1
69 81
 target2.showInterface=false
70 82
 target2.type=ClassTarget
71
-target2.width=80
72
-target2.x=50
73
-target2.y=110
83
+target2.width=90
84
+target2.x=330
85
+target2.y=220
74 86
 target3.height=50
75
-target3.name=Calendar1
87
+target3.name=Account
76 88
 target3.showInterface=false
77 89
 target3.type=ClassTarget
78
-target3.width=90
79
-target3.x=330
80
-target3.y=220
90
+target3.width=80
91
+target3.x=50
92
+target3.y=110
81 93
 target4.height=50
82 94
 target4.name=Squares
83 95
 target4.showInterface=false
@@ -114,9 +126,9 @@ target8.width=80
114 126
 target8.x=350
115 127
 target8.y=290
116 128
 target9.height=50
117
-target9.name=DepositAccount
129
+target9.name=Scrabble
118 130
 target9.showInterface=false
119 131
 target9.type=ClassTarget
120
-target9.width=120
121
-target9.x=170
122
-target9.y=120
132
+target9.width=80
133
+target9.x=10
134
+target9.y=250