#15 Raymond Farria

Открыто
rayskeez21 хочет смерджить 1 коммит(ов) из rayskeez21/ZCW-Inheritance-AbstractBankAccount:master в master
27 измененных файлов: 1400 добавлений и 471 удалений
  1. 0
    16
      .idea/compiler.xml
  2. 0
    122
      .idea/misc.xml
  3. 2
    1
      .idea/modules.xml
  4. 124
    0
      .idea/uiDesigner.xml
  5. 861
    318
      .idea/workspace.xml
  6. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/ATM.class
  7. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/Account.class
  8. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/BusinessAccount.class
  9. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/CheckingAccount.class
  10. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/ConsolePrompt.class
  11. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/MainApplication.class
  12. Двоичные данные
      out/production/main/com/zipcodewilmington/bankaccountlab/SavingsAccount.class
  13. Двоичные данные
      out/test/test/com/zipcodewilmington/bankaccountlab/BusinessAccountTest.class
  14. Двоичные данные
      out/test/test/com/zipcodewilmington/bankaccountlab/CheckingAccountTest.class
  15. Двоичные данные
      out/test/test/com/zipcodewilmington/bankaccountlab/SavingsAccountTest.class
  16. 111
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/ATM.java
  17. 11
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/Account.java
  18. 0
    7
      src/main/java/com/zipcodewilmington/bankaccountlab/BankAccount.java
  19. 39
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java
  20. 41
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/CheckingAccount.java
  21. 21
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/ConsolePrompt.java
  22. 15
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java
  23. 44
    0
      src/main/java/com/zipcodewilmington/bankaccountlab/SavingsAccount.java
  24. 0
    7
      src/test/java/com/zipcodewilmington/bankaccountlab/BankAccountTest.java
  25. 43
    0
      src/test/java/com/zipcodewilmington/bankaccountlab/BusinessAccountTest.java
  26. 37
    0
      src/test/java/com/zipcodewilmington/bankaccountlab/CheckingAccountTest.java
  27. 51
    0
      src/test/java/com/zipcodewilmington/bankaccountlab/SavingsAccountTest.java

+ 0
- 16
.idea/compiler.xml Просмотреть файл

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CompilerConfiguration">
4
-    <annotationProcessing>
5
-      <profile name="Maven default annotation processors profile" enabled="true">
6
-        <sourceOutputDir name="target/generated-sources/annotations" />
7
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
-        <outputRelativeToContentRoot value="true" />
9
-        <module name="bankaccountlab" />
10
-      </profile>
11
-    </annotationProcessing>
12
-    <bytecodeTargetLevel target="1.8">
13
-      <module name="bankaccountlab" target="1.5" />
14
-    </bytecodeTargetLevel>
15
-  </component>
16
-</project>

+ 0
- 122
.idea/misc.xml Просмотреть файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <project version="4">
2
 <project version="4">
3
-  <component name="ClientPropertiesManager">
4
-    <properties class="javax.swing.AbstractButton">
5
-      <property name="hideActionText" class="java.lang.Boolean" />
6
-    </properties>
7
-    <properties class="javax.swing.JComponent">
8
-      <property name="html.disable" class="java.lang.Boolean" />
9
-    </properties>
10
-    <properties class="javax.swing.JEditorPane">
11
-      <property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
12
-      <property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
13
-      <property name="charset" class="java.lang.String" />
14
-    </properties>
15
-    <properties class="javax.swing.JList">
16
-      <property name="List.isFileList" class="java.lang.Boolean" />
17
-    </properties>
18
-    <properties class="javax.swing.JPasswordField">
19
-      <property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
20
-    </properties>
21
-    <properties class="javax.swing.JSlider">
22
-      <property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
23
-      <property name="JSlider.isFilled" class="java.lang.Boolean" />
24
-    </properties>
25
-    <properties class="javax.swing.JTable">
26
-      <property name="Table.isFileList" class="java.lang.Boolean" />
27
-      <property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
28
-      <property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
29
-    </properties>
30
-    <properties class="javax.swing.JToolBar">
31
-      <property name="JToolBar.isRollover" class="java.lang.Boolean" />
32
-    </properties>
33
-    <properties class="javax.swing.JTree">
34
-      <property name="JTree.lineStyle" class="java.lang.String" />
35
-    </properties>
36
-    <properties class="javax.swing.text.JTextComponent">
37
-      <property name="caretAspectRatio" class="java.lang.Double" />
38
-      <property name="caretWidth" class="java.lang.Integer" />
39
-    </properties>
40
-  </component>
41
-  <component name="MavenProjectsManager">
42
-    <option name="originalFiles">
43
-      <list>
44
-        <option value="$PROJECT_DIR$/pom.xml" />
45
-      </list>
46
-    </option>
47
-  </component>
48
-  <component name="ProjectInspectionProfilesVisibleTreeState">
49
-    <entry key="Project Default">
50
-      <profile-state>
51
-        <expanded-state>
52
-          <State>
53
-            <id />
54
-          </State>
55
-        </expanded-state>
56
-        <selected-state>
57
-          <State>
58
-            <id>Android</id>
59
-          </State>
60
-        </selected-state>
61
-      </profile-state>
62
-    </entry>
63
-  </component>
64
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
3
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
65
     <output url="file://$PROJECT_DIR$/out" />
4
     <output url="file://$PROJECT_DIR$/out" />
66
   </component>
5
   </component>
67
-  <component name="masterDetails">
68
-    <states>
69
-      <state key="GlobalLibrariesConfigurable.UI">
70
-        <settings>
71
-          <splitter-proportions>
72
-            <option name="proportions">
73
-              <list>
74
-                <option value="0.2" />
75
-              </list>
76
-            </option>
77
-          </splitter-proportions>
78
-        </settings>
79
-      </state>
80
-      <state key="JdkListConfigurable.UI">
81
-        <settings>
82
-          <last-edited>1.8</last-edited>
83
-          <splitter-proportions>
84
-            <option name="proportions">
85
-              <list>
86
-                <option value="0.2" />
87
-              </list>
88
-            </option>
89
-          </splitter-proportions>
90
-        </settings>
91
-      </state>
92
-      <state key="ProjectJDKs.UI">
93
-        <settings>
94
-          <last-edited>1.8</last-edited>
95
-          <splitter-proportions>
96
-            <option name="proportions">
97
-              <list>
98
-                <option value="0.2" />
99
-              </list>
100
-            </option>
101
-          </splitter-proportions>
102
-        </settings>
103
-      </state>
104
-      <state key="ProjectLibrariesConfigurable.UI">
105
-        <settings>
106
-          <splitter-proportions>
107
-            <option name="proportions">
108
-              <list>
109
-                <option value="0.2" />
110
-              </list>
111
-            </option>
112
-          </splitter-proportions>
113
-        </settings>
114
-      </state>
115
-      <state key="ScopeChooserConfigurable.UI">
116
-        <settings>
117
-          <splitter-proportions>
118
-            <option name="proportions">
119
-              <list>
120
-                <option value="0.2" />
121
-              </list>
122
-            </option>
123
-          </splitter-proportions>
124
-        </settings>
125
-      </state>
126
-    </states>
127
-  </component>
128
 </project>
6
 </project>

+ 2
- 1
.idea/modules.xml Просмотреть файл

2
 <project version="4">
2
 <project version="4">
3
   <component name="ProjectModuleManager">
3
   <component name="ProjectModuleManager">
4
     <modules>
4
     <modules>
5
-      <module fileurl="file://$PROJECT_DIR$/bankaccountlab.iml" filepath="$PROJECT_DIR$/bankaccountlab.iml" />
5
+      <module fileurl="file://$PROJECT_DIR$/src/main/main.iml" filepath="$PROJECT_DIR$/src/main/main.iml" />
6
+      <module fileurl="file://$PROJECT_DIR$/src/test/test.iml" filepath="$PROJECT_DIR$/src/test/test.iml" />
6
     </modules>
7
     </modules>
7
   </component>
8
   </component>
8
 </project>
9
 </project>

+ 124
- 0
.idea/uiDesigner.xml Просмотреть файл

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Palette2">
4
+    <group name="Swing">
5
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
6
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
7
+      </item>
8
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
9
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
10
+      </item>
11
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
12
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
13
+      </item>
14
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
15
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
16
+      </item>
17
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
18
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
19
+        <initial-values>
20
+          <property name="text" value="Button" />
21
+        </initial-values>
22
+      </item>
23
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
24
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
25
+        <initial-values>
26
+          <property name="text" value="RadioButton" />
27
+        </initial-values>
28
+      </item>
29
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
30
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
31
+        <initial-values>
32
+          <property name="text" value="CheckBox" />
33
+        </initial-values>
34
+      </item>
35
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
36
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
37
+        <initial-values>
38
+          <property name="text" value="Label" />
39
+        </initial-values>
40
+      </item>
41
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
42
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
43
+          <preferred-size width="150" height="-1" />
44
+        </default-constraints>
45
+      </item>
46
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
47
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
48
+          <preferred-size width="150" height="-1" />
49
+        </default-constraints>
50
+      </item>
51
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
52
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
53
+          <preferred-size width="150" height="-1" />
54
+        </default-constraints>
55
+      </item>
56
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
57
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
58
+          <preferred-size width="150" height="50" />
59
+        </default-constraints>
60
+      </item>
61
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
62
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
63
+          <preferred-size width="150" height="50" />
64
+        </default-constraints>
65
+      </item>
66
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
67
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
68
+          <preferred-size width="150" height="50" />
69
+        </default-constraints>
70
+      </item>
71
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
72
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
73
+      </item>
74
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
75
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
76
+          <preferred-size width="150" height="50" />
77
+        </default-constraints>
78
+      </item>
79
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
80
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
81
+          <preferred-size width="150" height="50" />
82
+        </default-constraints>
83
+      </item>
84
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
85
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
86
+          <preferred-size width="150" height="50" />
87
+        </default-constraints>
88
+      </item>
89
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
90
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
91
+          <preferred-size width="200" height="200" />
92
+        </default-constraints>
93
+      </item>
94
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
95
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
96
+          <preferred-size width="200" height="200" />
97
+        </default-constraints>
98
+      </item>
99
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
100
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
101
+      </item>
102
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
103
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
104
+      </item>
105
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
106
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
107
+      </item>
108
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
109
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
110
+      </item>
111
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
112
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
113
+          <preferred-size width="-1" height="20" />
114
+        </default-constraints>
115
+      </item>
116
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
117
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
118
+      </item>
119
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
120
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
121
+      </item>
122
+    </group>
123
+  </component>
124
+</project>

+ 861
- 318
.idea/workspace.xml
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/ATM.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/Account.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/BusinessAccount.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/CheckingAccount.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/ConsolePrompt.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/MainApplication.class Просмотреть файл


Двоичные данные
out/production/main/com/zipcodewilmington/bankaccountlab/SavingsAccount.class Просмотреть файл


Двоичные данные
out/test/test/com/zipcodewilmington/bankaccountlab/BusinessAccountTest.class Просмотреть файл


Двоичные данные
out/test/test/com/zipcodewilmington/bankaccountlab/CheckingAccountTest.class Просмотреть файл


Двоичные данные
out/test/test/com/zipcodewilmington/bankaccountlab/SavingsAccountTest.class Просмотреть файл


+ 111
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/ATM.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+import com.sun.tools.doclets.formats.html.SourceToHTMLConverter;
4
+
5
+import java.util.Scanner;
6
+
7
+public class ATM {
8
+    BusinessAccount ba;
9
+    CheckingAccount ca;
10
+    SavingsAccount sa;
11
+    Scanner atm;
12
+    Integer ans;
13
+
14
+    public void beginning(){
15
+       atm = new Scanner(System.in);
16
+        String input = atm.nextLine();
17
+        switch (input) {
18
+            case "1":
19
+                ba = new BusinessAccount();
20
+                ba.setAccount(10000);
21
+                ba.setCurrentMoney(2000);
22
+                System.out.print("Account: "+ ba.getAccount() + "CurrentMoney(" + ba.getCurrentMoney() + ")" + "\n");
23
+                businessAccount();
24
+                break;
25
+            case "2":
26
+                ca = new CheckingAccount();
27
+                ca.setAccount(5000);
28
+                ca.setCurrentMoney(500);
29
+                System.out.print("Account: "+ ca.getAccount() + "CurrentMoney(" + ca.getCurrentMoney() + ")" +"\n");
30
+                checkingAccount();
31
+                break;
32
+            case "3":
33
+                sa = new SavingsAccount();
34
+                sa.setAccount(1000);
35
+                sa.setCurrentMoney(100);
36
+                System.out.println("Account: "+ sa.getAccount() + " CurrentMoney(" + sa.getCurrentMoney() + ")" + "\n");
37
+                savingsAccount();
38
+               break;
39
+               default: System.out.println("Wrong input: Try again!!!");
40
+        }
41
+
42
+    }
43
+
44
+    public void businessAccount(){
45
+
46
+        System.out.println("What do you want to do to your Business account?" +"\n" + "1.)Add money" + "\n" + "2.)Take out money" + "\n" + "3.)View balance");
47
+        atm = new Scanner(System.in);
48
+        String input = atm.nextLine();
49
+        switch (input){
50
+            case "1":
51
+               ans =  ba.addMoney(ba.getAccount(), ba.getCurrentMoney());
52
+                System.out.println("New account balance: " + ans);
53
+                break;
54
+            case "2":
55
+                ans = ba.removeMoney(ba.getAccount(), ba.getCurrentMoney());
56
+                System.out.println("New account balance: " + ans);
57
+                break;
58
+            case "3":
59
+                ans = ba.trackMoney();
60
+                break;
61
+                default:
62
+                    System.out.println("Try Again");
63
+        }
64
+        beginning();
65
+    }
66
+    public void checkingAccount(){
67
+
68
+        System.out.println("What do you want to do to your Checking account?" +"\n" + "1.)Add money" + "\n" + "2.)Take out money" + "\n" + "3.)View balance");
69
+        atm = new Scanner(System.in);
70
+        String input = atm.nextLine();
71
+        switch (input){
72
+            case "1":
73
+                ans =  ca.addMoney(ca.getAccount(), ca.getCurrentMoney());
74
+                System.out.println("New account balance: " + ans);
75
+                break;
76
+            case "2":
77
+                ans = ca.removeMoney(ca.getAccount(), ca.getCurrentMoney());
78
+                System.out.println("New account balance: " + ans);
79
+                break;
80
+            case "3":
81
+                ans = ca.trackMoney();
82
+                break;
83
+            default:
84
+                System.out.println("Try Again");
85
+        }
86
+        beginning();
87
+    }
88
+
89
+    public void savingsAccount(){
90
+
91
+        System.out.println("What do you want to do to your Business account?" +"\n" + "1.)Add money" + "\n" + "2.)Take out money" + "\n" + "3.)View balance");
92
+        atm = new Scanner(System.in);
93
+        String input = atm.nextLine();
94
+        switch (input){
95
+            case "1":
96
+                ans =  sa.addMoney(sa.getAccount(), sa.getCurrentMoney());
97
+                System.out.println("New account balance: " + ans);
98
+                break;
99
+            case "2":
100
+                ans = sa.removeMoney(sa.getAccount(), sa.getCurrentMoney());
101
+                System.out.println("New account balance: " + ans);
102
+                break;
103
+            case "3":
104
+                ans = sa.trackMoney();
105
+                break;
106
+            default:
107
+                System.out.println("Try Again");
108
+        }
109
+        beginning();
110
+    }
111
+}

+ 11
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/Account.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+public abstract class Account {
4
+
5
+    public abstract Integer addMoney(Integer account, Integer currentMoney);
6
+    public abstract Integer removeMoney(Integer account, Integer currentMoney);
7
+    public abstract Integer trackMoney();
8
+
9
+
10
+
11
+}

+ 0
- 7
src/main/java/com/zipcodewilmington/bankaccountlab/BankAccount.java Просмотреть файл

1
-package com.zipcodewilmington.bankaccountlab;
2
-
3
-/**
4
- * Created by leon on 1/10/18.
5
- */
6
-public class BankAccount {
7
-}

+ 39
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/BusinessAccount.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+public class BusinessAccount extends Account {
4
+   public Integer currentMoney;
5
+   public Integer account ;
6
+
7
+
8
+   public BusinessAccount(){
9
+       }
10
+
11
+    public Integer getAccount() {return account; }
12
+
13
+    public void setCurrentMoney(Integer currentMoney) {
14
+        this.currentMoney = currentMoney;
15
+    }
16
+
17
+    public Integer getCurrentMoney() {
18
+        return currentMoney;
19
+    }
20
+
21
+    public void setAccount(Integer account) {
22
+        this.account = account;
23
+    }
24
+
25
+    @Override
26
+    public Integer addMoney(Integer account, Integer currentMoney) {
27
+        return account + currentMoney;
28
+    }
29
+
30
+    @Override
31
+    public Integer removeMoney(Integer account, Integer currentMoney) {
32
+        return account - currentMoney;
33
+    }
34
+
35
+    @Override
36
+    public Integer trackMoney() {
37
+        return this.account;
38
+    }
39
+}

+ 41
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/CheckingAccount.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+public class CheckingAccount extends Account {
4
+    public Integer account;
5
+    public Integer currentMoney;
6
+
7
+    public CheckingAccount(){
8
+
9
+    }
10
+
11
+    public void setAccount(Integer account) {
12
+        this.account = account;
13
+    }
14
+
15
+    public Integer getAccount() {
16
+        return account;
17
+    }
18
+
19
+    public void setCurrentMoney(Integer currentMoney) {
20
+        this.currentMoney = currentMoney;
21
+    }
22
+
23
+    public Integer getCurrentMoney() {
24
+        return currentMoney;
25
+    }
26
+
27
+    @Override
28
+    public Integer addMoney(Integer account, Integer currentMoney) {
29
+        return account + currentMoney;
30
+    }
31
+
32
+    @Override
33
+    public Integer removeMoney(Integer account, Integer currentMoney) {
34
+        return account - currentMoney;
35
+    }
36
+
37
+    @Override
38
+    public Integer trackMoney() {
39
+        return this.account;
40
+    }
41
+}

+ 21
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/ConsolePrompt.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+import java.util.Scanner;
4
+
5
+public class ConsolePrompt {
6
+    private void print(String output, Object... args){
7
+        System.out.printf(output, args);
8
+    }
9
+
10
+    private void println(String output, Object... args){
11
+        print(output + "\n", args);
12
+    }
13
+
14
+    public String stringScan(String prompt){
15
+        Scanner stringInput = new Scanner(System.in);
16
+        println(prompt);
17
+        String userInput = stringInput.nextLine();
18
+        return userInput.toLowerCase();
19
+    }
20
+
21
+}

+ 15
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/MainApplication.java Просмотреть файл

1
 package com.zipcodewilmington.bankaccountlab;
1
 package com.zipcodewilmington.bankaccountlab;
2
 
2
 
3
+import java.util.Scanner;
4
+
3
 /**
5
 /**
4
  * Created by leon on 1/10/18.
6
  * Created by leon on 1/10/18.
5
  */
7
  */
6
 public class MainApplication {
8
 public class MainApplication {
9
+    private static ATM atm;
10
+    ConsolePrompt console = new ConsolePrompt();
11
+
12
+
13
+
14
+
15
+    public static void main(String[] args) {
16
+        ATM atm = new ATM();
17
+        System.out.println("Welcome" + "\n" + "Which account would you like to access?" + "\n" + "1.)Business" + "\n" + "2.)Checkings" + "\n" + "3.)Savings");
18
+        atm.beginning();
19
+        System.out.println();
20
+
21
+    }
7
 }
22
 }

+ 44
- 0
src/main/java/com/zipcodewilmington/bankaccountlab/SavingsAccount.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+public class SavingsAccount extends Account {
4
+    public Integer currentMoney;
5
+    public Integer account;
6
+    private SavingsAccount sa;
7
+
8
+
9
+    public SavingsAccount(){
10
+
11
+    }
12
+
13
+    public void setAccount(Integer account) {
14
+        this.account = account;
15
+    }
16
+
17
+    public Integer getAccount() {
18
+        return account;
19
+    }
20
+
21
+    public void setCurrentMoney(Integer currentMoney) {
22
+        this.currentMoney = currentMoney;
23
+    }
24
+
25
+    public Integer getCurrentMoney() {
26
+        return currentMoney;
27
+    }
28
+
29
+    @Override
30
+    public Integer addMoney(Integer account, Integer currentMoney) {
31
+        return account + currentMoney;
32
+    }
33
+
34
+    @Override
35
+    public Integer removeMoney(Integer account, Integer currentMoney) {
36
+        return account - currentMoney;
37
+    }
38
+
39
+    @Override
40
+    public Integer trackMoney() {
41
+        return this.account;
42
+    }
43
+}
44
+

+ 0
- 7
src/test/java/com/zipcodewilmington/bankaccountlab/BankAccountTest.java Просмотреть файл

1
-package com.zipcodewilmington.bankaccountlab;
2
-
3
-/**
4
- * Created by leon on 1/10/18.
5
- */
6
-public class BankAccountTest {
7
-}

+ 43
- 0
src/test/java/com/zipcodewilmington/bankaccountlab/BusinessAccountTest.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+import org.junit.Before;
4
+import org.junit.Test;
5
+
6
+import static org.junit.Assert.*;
7
+
8
+
9
+public class BusinessAccountTest {
10
+
11
+    private Integer account;
12
+    private Integer currentMoney;
13
+
14
+
15
+
16
+    @Test
17
+    public void addMoneyTest() {
18
+        BusinessAccount bsAccount = new BusinessAccount();
19
+        Integer expected = 10100;
20
+        Integer actual = bsAccount.addMoney(10000, 100);
21
+
22
+        assertEquals(expected, actual);
23
+    }
24
+
25
+    @Test
26
+    public void removeMoneyTest() {
27
+        BusinessAccount bsAccount = new BusinessAccount();
28
+        Integer expected = 9900;
29
+        Integer actual = bsAccount.removeMoney(10000, 100);
30
+
31
+        assertEquals(expected,actual);
32
+    }
33
+
34
+    @Test
35
+    public void trackMoneyTest() {
36
+        BusinessAccount bsAccount = new BusinessAccount();
37
+        bsAccount.setAccount(1000);
38
+        Integer expected = 1000;
39
+        Integer actual = bsAccount.getAccount();
40
+
41
+        assertEquals(expected, actual);
42
+    }
43
+}

+ 37
- 0
src/test/java/com/zipcodewilmington/bankaccountlab/CheckingAccountTest.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+import org.junit.Test;
4
+
5
+import static org.junit.Assert.*;
6
+
7
+public class CheckingAccountTest {
8
+    private Integer account;
9
+    private Integer currentMoney;
10
+
11
+    @Test
12
+    public void addMoney() {
13
+        CheckingAccount check = new CheckingAccount();
14
+        Integer expected = 5000;
15
+        Integer actual = check.addMoney(4500,500);
16
+
17
+        assertEquals(expected, actual);
18
+    }
19
+
20
+    @Test
21
+    public void removeMoney() {
22
+        CheckingAccount check = new CheckingAccount();
23
+        Integer expected = 4500;
24
+        Integer actual = check.removeMoney(5000,500);
25
+
26
+        assertEquals(expected,actual);
27
+    }
28
+
29
+    @Test
30
+    public void trackMoney() {
31
+        CheckingAccount check = new CheckingAccount();
32
+        Integer expected = 1000;
33
+        Integer actual = check.trackMoney(1000);
34
+
35
+        assertEquals(expected, actual);
36
+    }
37
+}

+ 51
- 0
src/test/java/com/zipcodewilmington/bankaccountlab/SavingsAccountTest.java Просмотреть файл

1
+package com.zipcodewilmington.bankaccountlab;
2
+
3
+import org.junit.Before;
4
+import org.junit.Test;
5
+
6
+import static org.junit.Assert.*;
7
+
8
+public class SavingsAccountTest {
9
+    private Integer account;
10
+    private Integer currentMoney;
11
+
12
+
13
+    @Test
14
+    public void setCurrentMoney() {
15
+        SavingsAccount save = new SavingsAccount();
16
+        save.setCurrentMoney(1000);
17
+        Integer expected = 1000;
18
+        Integer actual = save.getCurrentMoney();
19
+
20
+        assertEquals(expected, actual);
21
+    }
22
+
23
+
24
+    @Test
25
+    public void addMoney() {
26
+        SavingsAccount save = new SavingsAccount();
27
+        Integer expected = 2200;
28
+        Integer actual = save.addMoney(2000,200);
29
+
30
+        assertEquals(expected, actual);
31
+    }
32
+
33
+    @Test
34
+    public void removeMoney() {
35
+        SavingsAccount save = new SavingsAccount();
36
+        Integer expected = 2000;
37
+        Integer actual = save.removeMoney(2200,200);
38
+
39
+        assertEquals(expected, actual);
40
+    }
41
+
42
+    @Test
43
+    public void trackMoney() {
44
+        SavingsAccount save = new SavingsAccount();
45
+        save.setAccount(12000);
46
+        Integer expected = 12000;
47
+        Integer actual = save.getAccount();
48
+
49
+        assertEquals(expected, actual);
50
+    }
51
+}