Arin Turpin 8 anos atrás
pai
commit
02c9bd65ec

+ 18
- 17
.idea/workspace.xml Ver arquivo

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

+ 23
- 6
src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java Ver arquivo

@@ -26,18 +26,30 @@ public class MainApplication {
26 26
     Atm atm = new Atm();
27 27
 
28 28
     public static void main(String[] vv) {
29
-        new MainApplication(name, email, address, pin).commandCenter();
29
+        new MainApplication().commandCenter();
30 30
 
31 31
 
32 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 53
             double balance = 00000.00;
42 54
 
43 55
             createBusinessAccount(name, email, address, pin, accountNumber, balance);
@@ -50,12 +62,13 @@ public class MainApplication {
50 62
     }
51 63
 
52 64
     public void commandCenter(){
65
+        Scanner scanner = new Scanner(System.in);
66
+
53 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 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 72
         int userInput = scanner.nextInt();
60 73
 
61 74
         switch(userInput){
@@ -116,6 +129,10 @@ public class MainApplication {
116 129
             case 11:
117 130
                 System.out.println("Peace");
118 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