diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..c2ba6ab
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+BankAccount
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..577caa2
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..8d66637
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml
new file mode 100644
index 0000000..d411041
--- /dev/null
+++ b/.idea/libraries/Maven__junit_junit_4_12.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..f58bbc1
--- /dev/null
+++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..46e8b78
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class structureJava
+
+
+ Code maturity issuesJava
+
+
+ Code style issuesJava
+
+
+ Google Web Toolkit issues
+
+
+ Java
+
+
+ Java language level migration aidsJava
+
+
+ Javadoc issuesJava
+
+
+ Performance issuesJava
+
+
+ Spring
+
+
+ Spring AOPSpring
+
+
+ TestNGJava
+
+
+ Threading issuesJava
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..767d9ff
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..dd0c1b8
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,907 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTyp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ Access_Control_Lab
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ Maven: junit:junit:4.12
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Access_Control_Lab.iml b/Access_Control_Lab.iml
new file mode 100644
index 0000000..03320bd
--- /dev/null
+++ b/Access_Control_Lab.iml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BankAccount.xml b/BankAccount.xml
new file mode 100644
index 0000000..482a142
--- /dev/null
+++ b/BankAccount.xml
@@ -0,0 +1,2 @@
+
+7Vjfb6M4EP5rIqUPXWHIj+axSba3J+V2q81K9+yAAavGzhrTJP3rd4xtAoHoSO5y+5IqUvHn8Xjw9zEzMAgW2f4PibfpXyIibOB70X4QLAe+j7zAg38aORhk5E0NkEgaWaMjsKYfxK20aEEjkjcMlRBM0W0TDAXnJFQNDEspdk2zWLDmrluckBawDjFro3/TSKUGfRp7R/wLoUnqdkaendng8C2RouB2v4EfxOWfmc6w82Xt8xRHYleDgs+DYCGFUOYq2y8I02frjs2sezkzW8UtCVd9FkynE/IUj3E0QyQMxpNH6+Eds8KexRzzNxusOrgDync0Y5jDaJ6qjAGI4DIWXK2tkR5jRhMO1yFEQyQA70QqCsf8bCeU2AIappRFK3wQhY45V3CGbjRPhaQf4Ba7PWBaKqsYf9KwWOuVAHuASpKDzas7CFRBK5wraxMKxvA2p5sq4AzLhPK5UEpk1sjd6QtlbCGYkOUBOFbtPZtwENA3t+cHN0r2Z0lBFdXwCBGRESUPYFI9P2bFoTncHZXozyyW1lRYgdiqP6k8HxUAF1YEPQXhtwQx8CdMU7ORcJWo8p4NEtF3Bz3CGkZz9S1+DkN4HhTE9AzYs5T4oCfOe4EQa446fPdfeqJaoEQ1FZsrKd6I45WLUtFxjWoLOSUzEquzOs63OKQ8WZU2y9ER+W5J0tAupYqsAdcx7SB9AibAX8zKPJDSKCJcq1UorLCRptbhVtDyEJeD8Rx+QPXC+zQejOG+FjBGxzH8tLlUC8Hh/jAtVUdA9zuSq74S7c4Mbc1akcKj2EukCI1uINKgQ6Qn3DN6mq0M9y6/o6uIz4AuvYNj+ocWwvIRtdQQtNUQdLDM8IawV5FTRYX2L43tCfu/g2A06pmGnm7A76iD30AXdsojm1+GayXhcAHkOCMPJtvo2mXn78ng/9TKU89s4Pk3UMuss4c5p4N7K3PDVmY0afYyQUeZGHUII5jeopdxnVRHM3PSuuAwVD8OW2LSSJhi2bs7ccuBQlXkbQf/2DbpxV+LzKxkQue0C7cGtWIe2uAjUWhVXOrjC7wzEfkVcqlx49LrBW6oflQgy3zH6vpYdDpcShyrV0iC8K5X1sV+pPTyDzmR57j0uxJJrUld1ZrUe195u1Iyu7iv7EoYaHSLvhK1X4fvjeV/zDCadjSWXRTforFE/+L1luYvEheRSRkbIRjBHK5KL16MWX5ZosuJsi1KvXK8C4j9cjdl8RqaFOntH9q+uldB2RmaitO5qFcAsClPSOkNikdnW35FLUmIq2rDh76VsfeHhJO9NmajP/nPgsrD0DaPqnYoV9SxUJKIOoaHzkHlsdLPBS5jScgHcS6v5avgL9f5uRfF31UU0bTj/aqzKs4uf7+C4fH7czlX+8gffP4F
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..e71615a
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,18 @@
+
+
+ 4.0.0
+
+ gross.ryan
+ BankAccount
+ 1.0-SNAPSHOT
+
+
+ junit
+ junit
+ 4.12
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/gross/ryan/Bank.java b/src/main/java/gross/ryan/Bank.java
new file mode 100644
index 0000000..720c910
--- /dev/null
+++ b/src/main/java/gross/ryan/Bank.java
@@ -0,0 +1,24 @@
+package gross.ryan;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * Created by ryangross on 1/17/17.
+ */
+public class Bank {
+
+ protected HashMap allAccounts = new HashMap();
+
+ protected void addAccount(String name, String type, double number) {
+ BankAccount anAcct = new BankAccount(name, type,number);
+ allAccounts.put(name, anAcct);
+ }
+
+ protected BankAccount getAccount(String name) {
+ if (allAccounts.containsKey(name)) {
+ return allAccounts.get(name);
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/gross/ryan/BankAccount.java b/src/main/java/gross/ryan/BankAccount.java
new file mode 100644
index 0000000..df24574
--- /dev/null
+++ b/src/main/java/gross/ryan/BankAccount.java
@@ -0,0 +1,143 @@
+package gross.ryan;
+
+import java.sql.Time;
+import java.util.ArrayList;
+import java.time.*;
+import java.util.Timer;
+
+
+/**
+ * Created by ryangross on 1/17/17.
+ */
+public class BankAccount {
+ private String acctType;
+ private double acctNumber;
+ private String overDraft = "protect";
+ private double acctBalance;
+ private String acctName;
+ private double interestRate = 0;
+ private String acctStatus = "open";
+ private ArrayList transactionLog = new ArrayList();
+ public enum allStatus {open, closed, frozen}
+ public enum overDraftOptions {yes, no, protect}
+ public enum kindsOfAccts{checking, savings, investment}
+
+
+ private String getType() {
+ return this.acctType;
+ }
+
+ public BankAccount(String aName, String type, double aNumber) {
+ this.acctName = aName;
+ //this.acctType = aType;
+ this.acctNumber = aNumber;
+ }
+
+ private String getStatus() {
+ return this.acctStatus;
+ }
+
+ private double getBalance(){
+ return this.acctBalance;
+
+ }
+
+ private void addToLog(String anAction) {
+ LocalDateTime occurredOn = LocalDateTime.now();
+ this.transactionLog.add(occurredOn + ": " + anAction);
+ }
+
+ protected String balanceInquiry() {
+ if (this.getStatus().equals(allStatus.open.toString())) {
+ this.addToLog("Balance Inquiry.");
+ return ("Current Balance: " + this.getBalance());
+ } else if (this.getStatus().equals(allStatus.closed.toString())) {
+ return "Account is closed.";
+ } else {
+ this.addToLog("Fraud Alert: Account Access Attempted");
+ return "Error: Please call 1-877-383-4802 for more information.";
+ }
+ }
+
+ private void setAccountName(String newName) {
+ if(this.getStatus().equals(allStatus.open)) {
+ this.acctName = newName;
+ }
+ }
+
+
+ protected boolean debitMoney(double someMoney) {
+ if (this.getStatus().equals(allStatus.open.toString())) {
+ this.addToLog("Deposit of " + someMoney + " successful.");
+ this.acctBalance += someMoney;
+ return true;
+ }
+ this.addToLog("Deposit of " + someMoney + " failed; closed/frozen acct.");
+ return false;
+ }
+
+ private String getOverDraft() {
+ return this.overDraft;
+ }
+
+ protected boolean overDraftProtect() {
+ if (this.getOverDraft().equals(overDraftOptions.protect.toString())) {
+ return true;
+ }
+ return false;
+ }
+
+
+ protected boolean creditMoney(double someMoney) {
+ if (this.getStatus().equals(allStatus.open.toString())) {
+ if (someMoney > this.acctBalance) {
+ if (this.overDraftProtect()) {
+ this.addToLog("Overdraft Protection: Transaction Blocked");
+ return false;
+ }
+ } else {
+ this.addToLog("Transaction for " + someMoney + ": " + "Account is over-drafted");
+ this.acctBalance -= someMoney;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected boolean closeAccount() {
+ if (this.getStatus().equals(allStatus.open.toString()) && this.getBalance() == 0) {
+ this.acctStatus = "closed";
+ this.addToLog("Account closed.");
+ return true;
+ }
+ return false;
+ }
+
+ protected void setOverDraft(String anOption) {
+ this.overDraft = anOption;
+ }
+
+ protected boolean reOpenAccount() {
+ if (this.acctStatus.equals(allStatus.frozen.toString())) {
+ this.acctStatus = "open";
+ this.acctStatus = "Account reopened.";
+ return true;
+ }
+ return false;
+ }
+
+
+ protected void setType(String newType) {
+ this.acctType = newType;
+ }
+ protected void setInterestRate(double aRate) {
+ if (!this.getType().equals(kindsOfAccts.checking.toString())) {
+ this.interestRate = aRate;
+ }
+ }
+
+ public void setStatus(String newStatus) {
+ this.acctStatus = newStatus;
+ }
+
+}
diff --git a/src/main/java/gross/ryan/Main.java b/src/main/java/gross/ryan/Main.java
new file mode 100644
index 0000000..387dc44
--- /dev/null
+++ b/src/main/java/gross/ryan/Main.java
@@ -0,0 +1,16 @@
+package gross.ryan;
+
+/**
+ * Created by ryangross on 1/17/17.
+ */
+public class Main {
+
+
+ public static void main(String[] args) {
+ Bank initBank = new Bank();
+ initBank.addAccount("ryan", "checking", 1234);
+ BankAccount myAccount = initBank.findAccount("ryan");
+ System.out.println(initBank.findAccount("ryan"));
+
+ }
+}
diff --git a/src/test/java/gross/ryan/BankAccountTest.java b/src/test/java/gross/ryan/BankAccountTest.java
new file mode 100644
index 0000000..c754ed4
--- /dev/null
+++ b/src/test/java/gross/ryan/BankAccountTest.java
@@ -0,0 +1,72 @@
+package gross.ryan;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Created by ryangross on 1/17/17.
+ */
+public class BankAccountTest {
+ BankAccount ryansAcct;
+ BankAccount fakeAcct;
+ BankAccount closedAcct;
+
+ @Before
+ public void setUp() {
+ ryansAcct = new BankAccount("Ryan Gross", "checking", 5000);
+ ryansAcct.setType("checking");
+ ryansAcct.debitMoney(50);
+
+ fakeAcct = new BankAccount("Fake", "savings", 50000);
+ fakeAcct.setStatus("frozen");
+
+ closedAcct = new BankAccount("Meh", "savings", 10000);
+ closedAcct.setStatus("closed");
+
+ }
+
+ @Test
+ public void balanceInquiryTest() {
+ Assert.assertEquals("Current Balance: 50.0", ryansAcct.balanceInquiry());
+ Assert.assertEquals("Account is closed.", closedAcct.balanceInquiry());
+ Assert.assertEquals("Error: Please call 1-877-383-4802 for more information.", fakeAcct.balanceInquiry());
+ }
+
+ @Test
+ public void debitMoneyTest() {
+ Assert.assertTrue(ryansAcct.debitMoney(50));
+ Assert.assertFalse(fakeAcct.debitMoney(10));
+ Assert.assertFalse(closedAcct.debitMoney(10));
+ }
+
+ @Test
+ public void checkOverDraftTest() {
+ Assert.assertTrue(ryansAcct.overDraftProtect());
+ ryansAcct.setOverDraft("no");
+ Assert.assertFalse(ryansAcct.overDraftProtect());
+ ryansAcct.setOverDraft("yes");
+ Assert.assertFalse(ryansAcct.overDraftProtect());
+ }
+
+ @Test
+ public void creditMoney() {
+ Assert.assertTrue(ryansAcct.creditMoney(50));
+ Assert.assertFalse(ryansAcct.creditMoney(50));
+ Assert.assertFalse(fakeAcct.creditMoney(50));
+ }
+ @Test
+ public void closeAccount() {
+ Assert.assertFalse(ryansAcct.closeAccount());
+ ryansAcct.creditMoney(50);
+ Assert.assertTrue(ryansAcct.closeAccount());
+ Assert.assertFalse(fakeAcct.closeAccount());
+ Assert.assertFalse(closedAcct.closeAccount());
+ }
+
+ @Test
+ public void reOpenAccount() {
+ Assert.assertTrue(fakeAcct.reOpenAccount());
+ Assert.assertFalse(closedAcct.reOpenAccount());
+ }
+}
diff --git a/target/classes/gross/ryan/Bank.class b/target/classes/gross/ryan/Bank.class
new file mode 100644
index 0000000..96f917d
Binary files /dev/null and b/target/classes/gross/ryan/Bank.class differ
diff --git a/target/classes/gross/ryan/BankAccount$allStatus.class b/target/classes/gross/ryan/BankAccount$allStatus.class
new file mode 100644
index 0000000..48a1ed4
Binary files /dev/null and b/target/classes/gross/ryan/BankAccount$allStatus.class differ
diff --git a/target/classes/gross/ryan/BankAccount$kindsOfAccts.class b/target/classes/gross/ryan/BankAccount$kindsOfAccts.class
new file mode 100644
index 0000000..4ebb47b
Binary files /dev/null and b/target/classes/gross/ryan/BankAccount$kindsOfAccts.class differ
diff --git a/target/classes/gross/ryan/BankAccount$overDraftOptions.class b/target/classes/gross/ryan/BankAccount$overDraftOptions.class
new file mode 100644
index 0000000..26c0f58
Binary files /dev/null and b/target/classes/gross/ryan/BankAccount$overDraftOptions.class differ
diff --git a/target/classes/gross/ryan/BankAccount.class b/target/classes/gross/ryan/BankAccount.class
new file mode 100644
index 0000000..daabf52
Binary files /dev/null and b/target/classes/gross/ryan/BankAccount.class differ
diff --git a/target/classes/gross/ryan/Main.class b/target/classes/gross/ryan/Main.class
new file mode 100644
index 0000000..a55cec2
Binary files /dev/null and b/target/classes/gross/ryan/Main.class differ
diff --git a/target/test-classes/gross/ryan/BankAccountTest.class b/target/test-classes/gross/ryan/BankAccountTest.class
new file mode 100644
index 0000000..c367518
Binary files /dev/null and b/target/test-classes/gross/ryan/BankAccountTest.class differ
diff --git a/target/test-classes/gross/ryan/BankTest.class b/target/test-classes/gross/ryan/BankTest.class
new file mode 100644
index 0000000..86bf603
Binary files /dev/null and b/target/test-classes/gross/ryan/BankTest.class differ