Arin Turpin 8 år sedan
förälder
incheckning
02c9bd65ec

+ 18
- 17
.idea/workspace.xml Visa fil

19
       <file leaf-file-name="Account.java" pinned="false" current-in-tab="false">
19
       <file leaf-file-name="Account.java" pinned="false" current-in-tab="false">
20
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
20
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
21
           <provider selected="true" editor-type-id="text-editor">
21
           <provider selected="true" editor-type-id="text-editor">
22
-            <state relative-caret-position="285">
22
+            <state relative-caret-position="30">
23
               <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="35" selection-end-column="5" />
23
               <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="35" selection-end-column="5" />
24
             </state>
24
             </state>
25
           </provider>
25
           </provider>
46
       <file leaf-file-name="MainApplication.java" pinned="false" current-in-tab="true">
46
       <file leaf-file-name="MainApplication.java" pinned="false" current-in-tab="true">
47
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
47
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
48
           <provider selected="true" editor-type-id="text-editor">
48
           <provider selected="true" editor-type-id="text-editor">
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" />
49
+            <state relative-caret-position="2010">
50
+              <caret line="134" column="83" selection-start-line="134" selection-start-column="83" selection-end-line="134" selection-end-column="83" />
51
               <folding>
51
               <folding>
52
                 <element signature="imports" expanded="true" />
52
                 <element signature="imports" expanded="true" />
53
               </folding>
53
               </folding>
133
   <component name="ProjectFrameBounds">
133
   <component name="ProjectFrameBounds">
134
     <option name="y" value="22" />
134
     <option name="y" value="22" />
135
     <option name="width" value="1280" />
135
     <option name="width" value="1280" />
136
-    <option name="height" value="695" />
136
+    <option name="height" value="691" />
137
   </component>
137
   </component>
138
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
138
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
139
     <ConfirmationsSetting value="2" id="Add" />
139
     <ConfirmationsSetting value="2" id="Add" />
401
       <workItem from="1530052687470" duration="3570000" />
401
       <workItem from="1530052687470" duration="3570000" />
402
       <workItem from="1530104705459" duration="11034000" />
402
       <workItem from="1530104705459" duration="11034000" />
403
       <workItem from="1530147701778" duration="3578000" />
403
       <workItem from="1530147701778" duration="3578000" />
404
-      <workItem from="1530226930930" duration="4552000" />
404
+      <workItem from="1530226930930" duration="4715000" />
405
+      <workItem from="1530276094513" duration="1629000" />
405
     </task>
406
     </task>
406
     <servers />
407
     <servers />
407
   </component>
408
   </component>
438
     </history-entry>
439
     </history-entry>
439
   </component>
440
   </component>
440
   <component name="TimeTrackingManager">
441
   <component name="TimeTrackingManager">
441
-    <option name="totallyTimeSpent" value="44079000" />
442
+    <option name="totallyTimeSpent" value="45871000" />
442
   </component>
443
   </component>
443
   <component name="ToolWindowManager">
444
   <component name="ToolWindowManager">
444
-    <frame x="0" y="22" width="1280" height="695" extended-state="0" />
445
+    <frame x="0" y="22" width="1280" height="691" extended-state="6" />
445
     <editor active="true" />
446
     <editor active="true" />
446
     <layout>
447
     <layout>
447
       <window_info anchor="right" id="Palette" order="3" />
448
       <window_info anchor="right" id="Palette" order="3" />
448
       <window_info anchor="bottom" id="TODO" order="6" />
449
       <window_info anchor="bottom" id="TODO" order="6" />
449
-      <window_info anchor="bottom" id="Messages" order="11" weight="0.32683486" />
450
       <window_info anchor="right" id="Palette&#9;" order="9" />
450
       <window_info anchor="right" id="Palette&#9;" order="9" />
451
       <window_info id="Image Layers" order="7" />
451
       <window_info id="Image Layers" order="7" />
452
       <window_info anchor="right" id="Capture Analysis" order="4" />
452
       <window_info anchor="right" id="Capture Analysis" order="4" />
466
       <window_info anchor="right" id="Theme Preview" order="7" />
466
       <window_info anchor="right" id="Theme Preview" order="7" />
467
       <window_info id="Favorites" order="5" side_tool="true" />
467
       <window_info id="Favorites" order="5" side_tool="true" />
468
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
468
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
469
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32683486" />
469
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
470
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
470
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
471
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
471
       <window_info id="Nl-Palette" order="6" />
472
       <window_info id="Nl-Palette" order="6" />
699
         </state>
700
         </state>
700
       </provider>
701
       </provider>
701
     </entry>
702
     </entry>
702
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
703
-      <provider selected="true" editor-type-id="text-editor">
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" />
706
-        </state>
707
-      </provider>
708
-    </entry>
709
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java">
703
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java">
710
       <provider selected="true" editor-type-id="text-editor">
704
       <provider selected="true" editor-type-id="text-editor">
711
         <state relative-caret-position="60">
705
         <state relative-caret-position="60">
720
         </state>
714
         </state>
721
       </provider>
715
       </provider>
722
     </entry>
716
     </entry>
717
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/Account.java">
718
+      <provider selected="true" editor-type-id="text-editor">
719
+        <state relative-caret-position="30">
720
+          <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="35" selection-end-column="5" />
721
+        </state>
722
+      </provider>
723
+    </entry>
723
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
724
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java">
724
       <provider selected="true" editor-type-id="text-editor">
725
       <provider selected="true" editor-type-id="text-editor">
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" />
726
+        <state relative-caret-position="2010">
727
+          <caret line="134" column="83" selection-start-line="134" selection-start-column="83" selection-end-line="134" selection-end-column="83" />
727
           <folding>
728
           <folding>
728
             <element signature="imports" expanded="true" />
729
             <element signature="imports" expanded="true" />
729
           </folding>
730
           </folding>

+ 23
- 6
src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java Visa fil

26
     Atm atm = new Atm();
26
     Atm atm = new Atm();
27
 
27
 
28
     public static void main(String[] vv) {
28
     public static void main(String[] vv) {
29
-        new MainApplication(name, email, address, pin).commandCenter();
29
+        new MainApplication().commandCenter();
30
 
30
 
31
 
31
 
32
         System.out.println("Baller ATM only...");
32
         System.out.println("Baller ATM only...");
33
-        MainApplication mainApplication = new MainApplication(name, email, address, pin);
33
+        MainApplication mainApplication = new MainApplication();
34
     }
34
     }
35
 
35
 
36
 
36
 
37
-    public MainApplication(String name, String email, String address, int pin) {
37
+    public MainApplication() {
38
+        Scanner scannerr = new Scanner(System.in);
38
 
39
 
40
+        System.out.println("Enter your name.");
41
+        name = scannerr.nextLine();
39
 
42
 
40
-            long accountNumber = Math.round(Math.random() * 999999999);
43
+        System.out.println("Enter your email address.");
44
+        email = scannerr.nextLine();
45
+
46
+        System.out.println("Enter your address.");
47
+        address = scannerr.nextLine();
48
+
49
+        System.out.println("Create a pin number.");
50
+        pin = scannerr.nextInt();
51
+
52
+        long accountNumber = Math.round(Math.random() * 999999999);
41
             double balance = 00000.00;
53
             double balance = 00000.00;
42
 
54
 
43
             createBusinessAccount(name, email, address, pin, accountNumber, balance);
55
             createBusinessAccount(name, email, address, pin, accountNumber, balance);
50
     }
62
     }
51
 
63
 
52
     public void commandCenter(){
64
     public void commandCenter(){
65
+        Scanner scanner = new Scanner(System.in);
66
+
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());
67
         System.out.println("Your Checking Account balance is: " + checkingAccount.getBalance() +"\nYour Savings Account Balance is: " +savingsAccount.getBalance()+"\nYour Business Account balance is: "+businessAccount.getBalance());
54
 
68
 
55
-        Scanner scanner = new Scanner(System.in);
56
 
69
 
57
         System.out.println("Choose a command");
70
         System.out.println("Choose a command");
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.");
71
+        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\n'12' - Forgot pin");
59
         int userInput = scanner.nextInt();
72
         int userInput = scanner.nextInt();
60
 
73
 
61
         switch(userInput){
74
         switch(userInput){
116
             case 11:
129
             case 11:
117
                 System.out.println("Peace");
130
                 System.out.println("Peace");
118
                 runCommandCenter = false;
131
                 runCommandCenter = false;
132
+                break;
133
+
134
+            case 12:
135
+                System.out.println("Your pin number is " + businessAccount.getPin());
119
 
136
 
120
         }
137
         }
121
 
138