Arin Turpin 8 年 前
コミット
b2172a7677
共有2 個のファイルを変更した60 個の追加77 個の削除を含む
  1. 37
    60
      .idea/workspace.xml
  2. 23
    17
      src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java

+ 37
- 60
.idea/workspace.xml ファイルの表示

@@ -2,20 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="268ab437-e0d5-4447-8401-9f321aad6d50" name="Default" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Atm.java" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/CheckingAccount.java" afterDir="false" />
11
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/SavingsAccount.java" afterDir="false" />
12
-      <change afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/bankaccountlab/CheckingAccountTest.java" afterDir="false" />
13
-      <change afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/bankaccountlab/TestAtm.java" afterDir="false" />
14 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
15
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
16
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BankAccount.java" beforeDir="false" />
17 6
       <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java" afterDir="false" />
18
-      <change beforePath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/bankaccountlab/BankAccountTest.java" beforeDir="false" />
19 7
     </list>
20 8
     <ignored path="$PROJECT_DIR$/out/" />
21 9
     <ignored path="$PROJECT_DIR$/target/" />
@@ -31,8 +19,8 @@
31 19
       <file leaf-file-name="Account.java" pinned="false" current-in-tab="false">
32 20
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
33 21
           <provider selected="true" editor-type-id="text-editor">
34
-            <state relative-caret-position="270">
35
-              <caret line="22" column="33" selection-start-line="22" selection-start-column="33" selection-end-line="22" selection-end-column="33" />
22
+            <state relative-caret-position="285">
23
+              <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="35" selection-end-column="5" />
36 24
             </state>
37 25
           </provider>
38 26
         </entry>
@@ -58,8 +46,8 @@
58 46
       <file leaf-file-name="MainApplication.java" pinned="false" current-in-tab="true">
59 47
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
60 48
           <provider selected="true" editor-type-id="text-editor">
61
-            <state relative-caret-position="209">
62
-              <caret line="111" column="76" selection-start-line="111" selection-start-column="76" selection-end-line="111" selection-end-column="76" />
49
+            <state relative-caret-position="334">
50
+              <caret line="57" column="512" selection-start-line="57" selection-start-column="512" selection-end-line="57" selection-end-column="512" />
63 51
               <folding>
64 52
                 <element signature="imports" expanded="true" />
65 53
               </folding>
@@ -142,10 +130,10 @@
142 130
   <component name="NodePackageJsonFileManager">
143 131
     <packageJsonPaths />
144 132
   </component>
145
-  <component name="ProjectFrameBounds" extendedState="6">
133
+  <component name="ProjectFrameBounds">
146 134
     <option name="y" value="22" />
147
-    <option name="width" value="882" />
148
-    <option name="height" value="702" />
135
+    <option name="width" value="1280" />
136
+    <option name="height" value="695" />
149 137
   </component>
150 138
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
151 139
     <ConfirmationsSetting value="2" id="Add" />
@@ -187,35 +175,23 @@
187 175
       </list>
188 176
     </option>
189 177
   </component>
190
-  <component name="RunManager" selected="JUnit.TestAtm.testGetBalance">
178
+  <component name="RunManager" selected="Application.MainApplication">
191 179
     <configuration default="true" type="Applet" factoryName="Applet">
192 180
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
193 181
     </configuration>
194
-    <configuration default="true" type="Application" factoryName="Application">
195
-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
196
-    </configuration>
197
-    <configuration name="BankAccountTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
182
+    <configuration name="MainApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
183
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.bankaccountlab.MainApplication" />
198 184
       <module name="bankaccountlab" />
185
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
199 186
       <extension name="coverage">
200 187
         <pattern>
201 188
           <option name="PATTERN" value="com.zipcodewilmington.bankaccountlab.*" />
202 189
           <option name="ENABLED" value="true" />
203 190
         </pattern>
204 191
       </extension>
205
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
206
-      <option name="ALTERNATIVE_JRE_PATH" />
207
-      <option name="PACKAGE_NAME" value="com.zipcodewilmington.bankaccountlab" />
208
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.bankaccountlab.BankAccountTest" />
209
-      <option name="METHOD_NAME" />
210
-      <option name="TEST_OBJECT" value="class" />
211
-      <option name="VM_PARAMETERS" value="-ea" />
212
-      <option name="PARAMETERS" />
213
-      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
214
-      <option name="PASS_PARENT_ENVS" value="true" />
215
-      <option name="TEST_SEARCH_SCOPE">
216
-        <value defaultName="singleModule" />
217
-      </option>
218
-      <patterns />
192
+    </configuration>
193
+    <configuration default="true" type="Application" factoryName="Application">
194
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
219 195
     </configuration>
220 196
     <configuration name="CheckingAccountTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
221 197
       <module name="bankaccountlab" />
@@ -388,19 +364,19 @@
388 364
       <method />
389 365
     </configuration>
390 366
     <list>
391
-      <item itemvalue="JUnit.BankAccountTest" />
392 367
       <item itemvalue="JUnit.CheckingAccountTest" />
393 368
       <item itemvalue="JUnit.CheckingAccountTest.test_Get_Balance" />
394 369
       <item itemvalue="JUnit.CheckingAccountTest.testPay_WriteCheck" />
395 370
       <item itemvalue="JUnit.TestAtm.testGetBalance" />
371
+      <item itemvalue="Application.MainApplication" />
396 372
     </list>
397 373
     <recent_temporary>
398 374
       <list>
375
+        <item itemvalue="Application.MainApplication" />
399 376
         <item itemvalue="JUnit.TestAtm.testGetBalance" />
400 377
         <item itemvalue="JUnit.CheckingAccountTest.testPay_WriteCheck" />
401 378
         <item itemvalue="JUnit.CheckingAccountTest" />
402 379
         <item itemvalue="JUnit.CheckingAccountTest.test_Get_Balance" />
403
-        <item itemvalue="JUnit.BankAccountTest" />
404 380
       </list>
405 381
     </recent_temporary>
406 382
   </component>
@@ -424,7 +400,8 @@
424 400
       <workItem from="1529932838635" duration="1051000" />
425 401
       <workItem from="1530052687470" duration="3570000" />
426 402
       <workItem from="1530104705459" duration="11034000" />
427
-      <workItem from="1530147701778" duration="3518000" />
403
+      <workItem from="1530147701778" duration="3578000" />
404
+      <workItem from="1530226930930" duration="4552000" />
428 405
     </task>
429 406
     <servers />
430 407
   </component>
@@ -461,14 +438,15 @@
461 438
     </history-entry>
462 439
   </component>
463 440
   <component name="TimeTrackingManager">
464
-    <option name="totallyTimeSpent" value="39467000" />
441
+    <option name="totallyTimeSpent" value="44079000" />
465 442
   </component>
466 443
   <component name="ToolWindowManager">
467
-    <frame x="0" y="22" width="1280" height="705" extended-state="6" />
444
+    <frame x="0" y="22" width="1280" height="695" extended-state="0" />
468 445
     <editor active="true" />
469 446
     <layout>
470 447
       <window_info anchor="right" id="Palette" order="3" />
471 448
       <window_info anchor="bottom" id="TODO" order="6" />
449
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32683486" />
472 450
       <window_info anchor="right" id="Palette&#9;" order="9" />
473 451
       <window_info id="Image Layers" order="7" />
474 452
       <window_info anchor="right" id="Capture Analysis" order="4" />
@@ -476,7 +454,7 @@
476 454
       <window_info anchor="right" id="Maven Projects" order="5" />
477 455
       <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
478 456
       <window_info anchor="bottom" id="Version Control" order="9" />
479
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32324842" />
457
+      <window_info anchor="bottom" id="Run" order="2" weight="0.32110092" />
480 458
       <window_info anchor="bottom" id="Terminal" order="7" weight="0.32901135" />
481 459
       <window_info id="Capture Tool" order="4" />
482 460
       <window_info id="Designer" order="2" />
@@ -488,7 +466,6 @@
488 466
       <window_info anchor="right" id="Theme Preview" order="7" />
489 467
       <window_info id="Favorites" order="5" side_tool="true" />
490 468
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
491
-      <window_info anchor="bottom" id="Messages" order="11" weight="0.3280255" />
492 469
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
493 470
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
494 471
       <window_info id="Nl-Palette" order="6" />
@@ -704,13 +681,6 @@
704 681
         </state>
705 682
       </provider>
706 683
     </entry>
707
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java">
708
-      <provider selected="true" editor-type-id="text-editor">
709
-        <state relative-caret-position="60">
710
-          <caret line="4" column="113" selection-start-line="4" selection-start-column="113" selection-end-line="4" selection-end-column="113" />
711
-        </state>
712
-      </provider>
713
-    </entry>
714 684
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/SavingsAccount.java">
715 685
       <provider selected="true" editor-type-id="text-editor">
716 686
         <state relative-caret-position="60">
@@ -729,24 +699,31 @@
729 699
         </state>
730 700
       </provider>
731 701
     </entry>
732
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Atm.java">
702
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
733 703
       <provider selected="true" editor-type-id="text-editor">
734
-        <state relative-caret-position="45">
735
-          <caret line="3" selection-start-line="3" selection-end-line="3" />
704
+        <state relative-caret-position="285">
705
+          <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="35" selection-end-column="5" />
736 706
         </state>
737 707
       </provider>
738 708
     </entry>
739
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
709
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java">
710
+      <provider selected="true" editor-type-id="text-editor">
711
+        <state relative-caret-position="60">
712
+          <caret line="4" column="113" selection-start-line="4" selection-start-column="113" selection-end-line="4" selection-end-column="113" />
713
+        </state>
714
+      </provider>
715
+    </entry>
716
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Atm.java">
740 717
       <provider selected="true" editor-type-id="text-editor">
741
-        <state relative-caret-position="270">
742
-          <caret line="22" column="33" selection-start-line="22" selection-start-column="33" selection-end-line="22" selection-end-column="33" />
718
+        <state relative-caret-position="45">
719
+          <caret line="3" selection-start-line="3" selection-end-line="3" />
743 720
         </state>
744 721
       </provider>
745 722
     </entry>
746 723
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
747 724
       <provider selected="true" editor-type-id="text-editor">
748
-        <state relative-caret-position="209">
749
-          <caret line="111" column="76" selection-start-line="111" selection-start-column="76" selection-end-line="111" selection-end-column="76" />
725
+        <state relative-caret-position="334">
726
+          <caret line="57" column="512" selection-start-line="57" selection-start-column="512" selection-end-line="57" selection-end-column="512" />
750 727
           <folding>
751 728
             <element signature="imports" expanded="true" />
752 729
           </folding>

+ 23
- 17
src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java ファイルの表示

@@ -11,11 +11,11 @@ import java.util.Scanner;
11 11
 
12 12
 public class MainApplication {
13 13
 
14
-    private String name;
15
-    private String email;
16
-    private String address;
17
-    private int pin;
18
-    private boolean runCommandCenter;
14
+    private static String name;
15
+    private static String email;
16
+    private static String address;
17
+    private static int pin;
18
+    private boolean runCommandCenter = true;
19 19
     private CheckingAccount checkingAccount;
20 20
     private BusinessAccount businessAccount;
21 21
     private SavingsAccount savingsAccount;
@@ -25,36 +25,37 @@ public class MainApplication {
25 25
 
26 26
     Atm atm = new Atm();
27 27
 
28
-    public void main(String[] vv) {
28
+    public static void main(String[] vv) {
29
+        new MainApplication(name, email, address, pin).commandCenter();
29 30
 
30
-        while(runCommandCenter){
31
-            commandCenter();
32
-        }
33 31
 
34 32
         System.out.println("Baller ATM only...");
35 33
         MainApplication mainApplication = new MainApplication(name, email, address, pin);
36
-
37 34
     }
38 35
 
39 36
 
40 37
     public MainApplication(String name, String email, String address, int pin) {
41 38
 
42
-        long accountNumber = Math.round(Math.random() * 999999999);
43
-        double balance = 00000.00;
44 39
 
45
-        createBusinessAccount(name, email, address, pin, accountNumber, balance);
46
-        createSavingsAccount(name, email, address, pin, accountNumber, balance);
47
-        createCheckingAccount(name, email, address, pin, accountNumber, balance);
40
+            long accountNumber = Math.round(Math.random() * 999999999);
41
+            double balance = 00000.00;
48 42
 
43
+            createBusinessAccount(name, email, address, pin, accountNumber, balance);
44
+            createSavingsAccount(name, email, address, pin, accountNumber, balance);
45
+            createCheckingAccount(name, email, address, pin, accountNumber, balance);
49 46
 
47
+        while(runCommandCenter){
48
+            commandCenter();
49
+        }
50 50
     }
51 51
 
52 52
     public void commandCenter(){
53
+        System.out.println("Your Checking Account balance is: " + checkingAccount.getBalance() +"\nYour Savings Account Balance is: " +savingsAccount.getBalance()+"\nYour Business Account balance is: "+businessAccount.getBalance());
53 54
 
54 55
         Scanner scanner = new Scanner(System.in);
55 56
 
56 57
         System.out.println("Choose a command");
57
-        System.out.println("'1' - Get the balance of your Checking Account \n'2' - Get the balance of your Savings Account \n'3' - Get balance of your Business Account\n'4' - Deposit money to your Checking Account\n'5' - Deposit money to your Savings Account\n'6' - Deposit money to your Business Account\n'7' - Withdraw money from your Checking Account\n'8' - Withdraw money from your Savings Account\n'9' - Withdraw money from your Business Account\n'10' - Change the pin of your accounts\n'11' - Transfer funds between accounts");
58
+        System.out.println("'1' - Get the balance of your Checking Account \n'2' - Get the balance of your Savings Account \n'3' - Get balance of your Business Account\n'4' - Deposit money to your Checking Account\n'5' - Deposit money to your Savings Account\n'6' - Deposit money to your Business Account\n'7' - Withdraw money from your Checking Account\n'8' - Withdraw money from your Savings Account\n'9' - Withdraw money from your Business Account\n'10' - Change the pin of your accounts\n'11' - Turn ATM off.");
58 59
         int userInput = scanner.nextInt();
59 60
 
60 61
         switch(userInput){
@@ -109,7 +110,12 @@ public class MainApplication {
109 110
             case 10:
110 111
                 System.out.println("Enter a new pin number.");
111 112
                 atm.changePin(businessAccount, scanner.nextInt());
112
-                //might have to change all of the pin number individually...
113
+                //might have to change all of the pin numbers individually...
114
+                break;
115
+
116
+            case 11:
117
+                System.out.println("Peace");
118
+                runCommandCenter = false;
113 119
 
114 120
         }
115 121