From c530ac6d02709af0d45499c10a5f9852ba214a1c Mon Sep 17 00:00:00 2001 From: foyaz-95 <50546819+foyaz-95@users.noreply.github.com> Date: Sun, 12 May 2019 14:53:07 +0100 Subject: [PATCH 1/5] Test Submission *added method to calculate daily compound interest given annual rate *added method for transfers between accounts *introduced concept of a "business date" to simulate different points in time *edited method to switch between different rates based on account type *edited summary for customers to include balance + interest accrued *added tests to TransactionTest to check deposit/withdrawal/transfers/view a customers transactions) --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 3994d594..f1ca82ab 100644 --- a/pom.xml +++ b/pom.xml @@ -5,6 +5,18 @@ com.abc bank 1.0-SNAPSHOT + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + jar bank From 1327e86b0c7e098243025f29eb88332aecd75e37 Mon Sep 17 00:00:00 2001 From: foyaz-95 <50546819+foyaz-95@users.noreply.github.com> Date: Sun, 12 May 2019 14:54:16 +0100 Subject: [PATCH 2/5] Add files via upload --- src/main/java/com/abc/Account.java | 119 ++++++++++++++++++++---- src/main/java/com/abc/Bank.java | 25 ++++- src/main/java/com/abc/Customer.java | 50 ++++++++-- src/main/java/com/abc/DateProvider.java | 8 ++ src/main/java/com/abc/Transaction.java | 8 +- 5 files changed, 183 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/abc/Account.java b/src/main/java/com/abc/Account.java index 099691e0..b423d2c4 100644 --- a/src/main/java/com/abc/Account.java +++ b/src/main/java/com/abc/Account.java @@ -1,7 +1,18 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; import java.util.List; +import java.util.concurrent.TimeUnit; + +import static java.lang.Math.abs; public class Account { @@ -12,9 +23,14 @@ public class Account { private final int accountType; public List transactions; + private DateProvider dateProvider = new DateProvider(); + private Date dateOpened; + public Account(int accountType) { this.accountType = accountType; - this.transactions = new ArrayList(); + this.transactions = new ArrayList<>(); + dateOpened = dateProvider.now(); + System.out.println("date account opened: "+dateProvider.dateFormat(dateOpened)); } public void deposit(double amount) { @@ -33,28 +49,99 @@ public void withdraw(double amount) { } } - public double interestEarned() { +public void transfer(Account to, double amount){ + // boolean success = false; + try{ + withdraw(amount); + to.deposit(amount); + //success=true; + }catch (Exception e){ + e.printStackTrace(); + //success = false; + } + // return success; +} + + public double interestEarned(Date businessDate) { double amount = sumTransactions(); + DecimalFormat df = new DecimalFormat("#.##"); switch(accountType){ - case SAVINGS: - if (amount <= 1000) - return amount * 0.001; - else - return 1 + (amount-1000) * 0.002; -// case SUPER_SAVINGS: -// if (amount <= 4000) -// return 20; + case SAVINGS : + double interest = 0; + if (amount <= 1000){ + interest = Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount,0.001)));//0.1% + }else { + interest = Double.valueOf(df.format(dailyCompoundedFormula(businessDate,1000,0.001)));//0.1% for first 1000 + interest+= Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount-1000,0.002)));//0.2% for rest + } + return Double.valueOf(df.format(interest)); case MAXI_SAVINGS: - if (amount <= 1000) - return amount * 0.02; - if (amount <= 2000) - return 20 + (amount-1000) * 0.05; - return 70 + (amount-2000) * 0.1; + double totalInterest = 0; + if (amount <= 1000){ + totalInterest = Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount,0.02)));//2% + }else if (amount>1000 && amount<=2000){ + totalInterest = Double.valueOf(df.format(dailyCompoundedFormula(businessDate,1000,0.02)));//2% for first 1000 + totalInterest+= Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount-1000,0.05)));//5% until 2000 + }else{ + System.out.println("more than 2k"); + totalInterest = Double.valueOf(df.format(dailyCompoundedFormula(businessDate,1000,0.02)));//2% for first 1000 + totalInterest+= Double.valueOf(df.format(dailyCompoundedFormula(businessDate,1000,0.05)));//5% until 2000 + totalInterest+= Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount-2000,0.10)));//10% for rest + } + return Double.valueOf(df.format(totalInterest)); + + //Checking Account (0.1%) default: - return amount * 0.001; + return (Double.valueOf(df.format(dailyCompoundedFormula(businessDate,amount,0.001)))); } } + //daily compounded interest formula + private double dailyCompoundedFormula(Date businessDate, double amount,double rate){ + double x = 1 + (rate/365); + + //accurately get days between two dates + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); + LocalDate date1 = LocalDate.parse(dateProvider.dateFormat(businessDate), formatter); + LocalDate date2 = LocalDate.parse(dateProvider.dateFormat(dateOpened), formatter); + long days = ChronoUnit.DAYS.between(date2,date1); + int daysPassed = (int) days; + + System.out.println("REAL business days passed from bank opening till simulated business date: "+daysPassed+" days"); + double multiplier = (Math.pow(x,daysPassed)) - 1; + return amount * multiplier; + //return Double.valueOf((amount + (amount*multiplier))); + } + + /* + //TODO: daily compounded interest formula for MAXI SAVINGS + private double dailyCompoundedFormula(Date businessDate,ArrayList withdrawalDates, double amount){ + double balance = 0; + + double fivePercentRate = 1 + (0.05/365); + double pointOnePercentRate = 1 + (0.001/365); + Collections.sort(withdrawalDates); + + Date dateFrom = dateOpened; + Date dateTo = businessDate; + + for (int i=0;i customers; + private DateProvider dateProvider = new DateProvider(); + private Date bankCreationDate; + private Date businessDate; + public Bank() { customers = new ArrayList(); + bankCreationDate = dateProvider.now(); + businessDate = bankCreationDate;//business day set to creation day of bank at inception + System.out.println("date bank opened: "+dateProvider.dateFormat(bankCreationDate)); + } + + public Date getCurrBusinessDate(){ + return businessDate; + } + //to "roll" or move forward business date to simulate some amount of time between bankCreationDate and businessDate + public void rollBusinessDate(int days){ + System.out.println("before roll date: "+dateProvider.dateFormat(getCurrBusinessDate())); + Calendar cal = Calendar. getInstance(); + cal.setTime(businessDate); + cal.add(Calendar.DATE, days); + businessDate=cal.getTime(); + System.out.println("after roll date: "+dateProvider.dateFormat(getCurrBusinessDate())); } public void addCustomer(Customer customer) { @@ -30,7 +53,7 @@ private String format(int number, String word) { public double totalInterestPaid() { double total = 0; for(Customer c: customers) - total += c.totalInterestEarned(); + total += c.totalInterestEarned(businessDate); return total; } diff --git a/src/main/java/com/abc/Customer.java b/src/main/java/com/abc/Customer.java index 31571685..0492d167 100644 --- a/src/main/java/com/abc/Customer.java +++ b/src/main/java/com/abc/Customer.java @@ -1,6 +1,8 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; import java.util.ArrayList; +import java.util.Date; import java.util.List; import static java.lang.Math.abs; @@ -27,26 +29,56 @@ public int getNumberOfAccounts() { return accounts.size(); } - public double totalInterestEarned() { + public double totalInterestEarned(Date businessDate) { double total = 0; for (Account a : accounts) - total += a.interestEarned(); + total += a.interestEarned(businessDate); return total; } - public String getStatement() { + public String getStatement(Bank bank) { String statement = null; statement = "Statement for " + name + "\n"; double total = 0.0; for (Account a : accounts) { - statement += "\n" + statementForAccount(a) + "\n"; - total += a.sumTransactions(); + statement += "\n" + statementForAccount(a,bank.getCurrBusinessDate()) + "\n"; + total += a.sumTransactions()+a.interestEarned(bank.getCurrBusinessDate()); } - statement += "\nTotal In All Accounts " + toDollars(total); + statement += "\nTotal In All Accounts (including interest): " + toDollars(total); return statement; } - private String statementForAccount(Account a) { + public String getTransactions(){ + + String checkingAccountTransacts = "CHECKING: "; + String savingsAccountTransacts = "SAVINGS: "; + String maxiSavingsAccountTransacts = "MAXI_SAVINGS: "; + + //go through each transaction for each account and record + for (Account a:accounts) { + for (Transaction t : a.transactions) { + if(a.getAccountType()==Account.CHECKING && t.getAmount()!=0){ + checkingAccountTransacts += t.getAmount() + ","; + }else if(a.getAccountType()==Account.SAVINGS && t.getAmount()!=0){ + savingsAccountTransacts += t.getAmount() + ","; + }else{ + if(t.getAmount()!=0) { + maxiSavingsAccountTransacts += t.getAmount() + ","; + } + } + } + + } + + //concat all and remove "," at end of line + String allTransacts = checkingAccountTransacts.substring(0,checkingAccountTransacts.length()-1)+"\n" + +savingsAccountTransacts.substring(0,savingsAccountTransacts.length()-1)+"\n" + +maxiSavingsAccountTransacts.substring(0,maxiSavingsAccountTransacts.length()-1); + System.out.println("all transacts:\n"+allTransacts); + return allTransacts; + } + + private String statementForAccount(Account a,Date businessDate) { String s = ""; //Translate to pretty account type @@ -68,7 +100,9 @@ private String statementForAccount(Account a) { s += " " + (t.amount < 0 ? "withdrawal" : "deposit") + " " + toDollars(t.amount) + "\n"; total += t.amount; } - s += "Total " + toDollars(total); + s += "Total (less interest): " + toDollars(total) + "\n" + + "Interest: "+ toDollars(a.interestEarned(businessDate)) +"\n" + + "Total: " + toDollars(total+a.interestEarned(businessDate)); return s; } diff --git a/src/main/java/com/abc/DateProvider.java b/src/main/java/com/abc/DateProvider.java index 035ee90b..ee9425c3 100644 --- a/src/main/java/com/abc/DateProvider.java +++ b/src/main/java/com/abc/DateProvider.java @@ -1,5 +1,7 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @@ -15,4 +17,10 @@ public static DateProvider getInstance() { public Date now() { return Calendar.getInstance().getTime(); } + + public String dateFormat(Date dateToConvert){ + final String formattedDate = new SimpleDateFormat("dd-MM-yyyy").format(dateToConvert); + return formattedDate; + } + } diff --git a/src/main/java/com/abc/Transaction.java b/src/main/java/com/abc/Transaction.java index c1f7c67e..230a9d2e 100644 --- a/src/main/java/com/abc/Transaction.java +++ b/src/main/java/com/abc/Transaction.java @@ -1,16 +1,20 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; -import java.util.Calendar; import java.util.Date; public class Transaction { public final double amount; - private Date transactionDate; + public Date transactionDate; public Transaction(double amount) { this.amount = amount; this.transactionDate = DateProvider.getInstance().now(); } + public double getAmount(){ + return amount; + } + } From 2671907858d5a8b816822d2034824186b3a391ba Mon Sep 17 00:00:00 2001 From: foyaz-95 <50546819+foyaz-95@users.noreply.github.com> Date: Sun, 12 May 2019 14:54:56 +0100 Subject: [PATCH 3/5] test submission --- src/test/java/com/abc/BankTest.java | 49 ++++++++---- src/test/java/com/abc/CustomerTest.java | 61 ++++++++++----- src/test/java/com/abc/TransactionTest.java | 88 ++++++++++++++++++++++ 3 files changed, 163 insertions(+), 35 deletions(-) diff --git a/src/test/java/com/abc/BankTest.java b/src/test/java/com/abc/BankTest.java index f8a82896..213de403 100644 --- a/src/test/java/com/abc/BankTest.java +++ b/src/test/java/com/abc/BankTest.java @@ -1,14 +1,14 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; import org.junit.Test; - import static org.junit.Assert.assertEquals; public class BankTest { private static final double DOUBLE_DELTA = 1e-15; @Test - public void customerSummary() { + public void testCustomerOneAccountSummary() { Bank bank = new Bank(); Customer john = new Customer("John"); john.openAccount(new Account(Account.CHECKING)); @@ -18,37 +18,56 @@ public void customerSummary() { } @Test - public void checkingAccount() { + public void testCustomerTwoAccountsSummary() { + Bank bank = new Bank(); + Customer john = new Customer("John"); + john.openAccount(new Account(Account.CHECKING)); + john.openAccount(new Account(Account.SAVINGS)); + bank.addCustomer(john); + + assertEquals("Customer Summary\n - John (2 accounts)", bank.customerSummary()); + } + + /*below tests use the concept of rolling a "business date" + 1. bank is created and bankOpeningDate & businessDate are set to current time + 2. accounts are created and money deposited + 3. businessDate is moved/rolled forward to some point in time + 4. total interest paid on all accounts until this date is calculated */ + @Test + public void testCheckingAccountTotalInterest() { Bank bank = new Bank(); Account checkingAccount = new Account(Account.CHECKING); Customer bill = new Customer("Bill").openAccount(checkingAccount); bank.addCustomer(bill); - checkingAccount.deposit(100.0); + checkingAccount.deposit(100000.0); + bank.rollBusinessDate(30);//simulate account having being opened for x days - assertEquals(0.1, bank.totalInterestPaid(), DOUBLE_DELTA); + assertEquals(8.22, bank.totalInterestPaid(), DOUBLE_DELTA); } @Test - public void savings_account() { + public void testSavingsAccountTotalInterest() { Bank bank = new Bank(); - Account checkingAccount = new Account(Account.SAVINGS); - bank.addCustomer(new Customer("Bill").openAccount(checkingAccount)); + Account savingsAccount = new Account(Account.SAVINGS); + bank.addCustomer(new Customer("Bill").openAccount(savingsAccount)); - checkingAccount.deposit(1500.0); + savingsAccount.deposit(100000.0); + bank.rollBusinessDate(60); - assertEquals(2.0, bank.totalInterestPaid(), DOUBLE_DELTA); + assertEquals(32.71, bank.totalInterestPaid(), DOUBLE_DELTA); } @Test - public void maxi_savings_account() { + public void testMaxiSavingsAccountTotalInterest() { Bank bank = new Bank(); - Account checkingAccount = new Account(Account.MAXI_SAVINGS); - bank.addCustomer(new Customer("Bill").openAccount(checkingAccount)); + Account maxiSavingsAccount = new Account(Account.MAXI_SAVINGS); + bank.addCustomer(new Customer("Bill").openAccount(maxiSavingsAccount)); - checkingAccount.deposit(3000.0); + maxiSavingsAccount.deposit(100000.0); + bank.rollBusinessDate(60); - assertEquals(170.0, bank.totalInterestPaid(), DOUBLE_DELTA); + assertEquals(1635.59, bank.totalInterestPaid(), DOUBLE_DELTA); } } diff --git a/src/test/java/com/abc/CustomerTest.java b/src/test/java/com/abc/CustomerTest.java index b8df9498..15fc9f05 100644 --- a/src/test/java/com/abc/CustomerTest.java +++ b/src/test/java/com/abc/CustomerTest.java @@ -1,3 +1,4 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; import org.junit.Ignore; @@ -7,51 +8,71 @@ public class CustomerTest { - @Test //Test customer statement generation - public void testApp(){ - + @Test //Test customer statement generation (including interest on balance, as of rolled business date [deposit/withdrawal dates not used currently]) + public void testCustomerStatement(){ + Bank bank = new Bank(); + //Create 2 accounts for customer "Henry" + Customer henry = new Customer("Henry"); Account checkingAccount = new Account(Account.CHECKING); Account savingsAccount = new Account(Account.SAVINGS); + henry.openAccount(checkingAccount); + henry.openAccount(savingsAccount); + bank.addCustomer(henry); - Customer henry = new Customer("Henry").openAccount(checkingAccount).openAccount(savingsAccount); + //deposit and withdraw from accounts + checkingAccount.deposit(100000); + savingsAccount.deposit(400000); + savingsAccount.withdraw(20000); - checkingAccount.deposit(100.0); - savingsAccount.deposit(4000.0); - savingsAccount.withdraw(200.0); + //roll date + bank.rollBusinessDate(100);//simulate account having being opened for x days + //check summary assertEquals("Statement for Henry\n" + "\n" + "Checking Account\n" + - " deposit $100.00\n" + - "Total $100.00\n" + + " deposit $100,000.00\n" + + "Total (less interest): $100,000.00\n" + + "Interest: "+ "$27.40\n" + + "Total: $100,027.40\n" + "\n" + "Savings Account\n" + - " deposit $4,000.00\n" + - " withdrawal $200.00\n" + - "Total $3,800.00\n" + + " deposit $400,000.00\n" + + " withdrawal $20,000.00\n" + + "Total (less interest): $380,000.00\n" + + "Interest: "+ "$208.00\n" + + "Total: $380,208.00\n" + "\n" + - "Total In All Accounts $3,900.00", henry.getStatement()); + "Total In All Accounts (including interest): $480,235.40", henry.getStatement(bank)); } @Test public void testOneAccount(){ - Customer oscar = new Customer("Oscar").openAccount(new Account(Account.SAVINGS)); + //create one account for customer "oscar" + Customer oscar = new Customer("Oscar"); + oscar.openAccount(new Account(Account.SAVINGS)); + assertEquals(1, oscar.getNumberOfAccounts()); } @Test public void testTwoAccount(){ - Customer oscar = new Customer("Oscar") - .openAccount(new Account(Account.SAVINGS)); + //create 2 accounts for customer "oscar" + Customer oscar = new Customer("Oscar"); + oscar.openAccount(new Account(Account.SAVINGS)); oscar.openAccount(new Account(Account.CHECKING)); + assertEquals(2, oscar.getNumberOfAccounts()); } - @Ignore - public void testThreeAcounts() { - Customer oscar = new Customer("Oscar") - .openAccount(new Account(Account.SAVINGS)); + @Test + public void testThreeAccounts() { + //create 3 accounts for customer "oscar" + Customer oscar = new Customer("Oscar"); + oscar.openAccount(new Account(Account.SAVINGS)); oscar.openAccount(new Account(Account.CHECKING)); + oscar.openAccount(new Account(Account.MAXI_SAVINGS)); + assertEquals(3, oscar.getNumberOfAccounts()); } } diff --git a/src/test/java/com/abc/TransactionTest.java b/src/test/java/com/abc/TransactionTest.java index 28983234..ad89b566 100644 --- a/src/test/java/com/abc/TransactionTest.java +++ b/src/test/java/com/abc/TransactionTest.java @@ -1,7 +1,9 @@ +/*Edited by: Foyaz Hasnath*/ package com.abc; import org.junit.Test; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class TransactionTest { @@ -10,4 +12,90 @@ public void transaction() { Transaction t = new Transaction(5); assertTrue(t instanceof Transaction); } + + @Test + //test deposit + public void testDeposit(){ + //Create an account for customer "Jack" + Customer jack = new Customer("Jack"); + Account checkingAccount = new Account(Account.CHECKING); + jack.openAccount(checkingAccount); + //deposit + checkingAccount.deposit(100.0); + + //check deposit transaction recorded + assertEquals("CHECKING: 100.0\n" + + "SAVINGS:\n" + + "MAXI_SAVINGS:", + jack.getTransactions() + ); + } + @Test + //test withdrawal + public void testWithdrawal(){ + //Create an account for customer "Harry" + Customer harry = new Customer("Harry"); + Account checkingAccount = new Account(Account.CHECKING); + harry.openAccount(checkingAccount); + //deposit + checkingAccount.deposit(100.0); + checkingAccount.withdraw(100.0); + + //check deposit then withdrawal transactions recorded + assertEquals("CHECKING: 100.0,-100.0\n" + + "SAVINGS:\n" + + "MAXI_SAVINGS:", + harry.getTransactions() + ); + } + + @Test + //test transfer from checking -> savings for customer "John" + public void testTransfer(){ + //Create an account for customer "John" + Customer john = new Customer("John"); + Account checkingAccount = new Account(Account.CHECKING); + Account savingsAccount = new Account(Account.SAVINGS); + john.openAccount(checkingAccount); + john.openAccount(savingsAccount); + //deposit + checkingAccount.deposit(100.0); + savingsAccount.deposit(100.0); + //transfer from checking -> savings + checkingAccount.transfer(savingsAccount,50.0); + + //check transfer transactions recorded + assertEquals("CHECKING: 100.0,-50.0\n" + + "SAVINGS: 100.0,50.0\n" + + "MAXI_SAVINGS:", + john.getTransactions() + ); + } + + @Test + //check all transactions for each account for customer "Jack" + public void testViewCustomerTransactions(){ + //Create an account for customer "Jack" + Customer jack = new Customer("Jack"); + Account checkingAccount = new Account(Account.CHECKING); + Account savingsAccount = new Account(Account.SAVINGS); + jack.openAccount(checkingAccount); + jack.openAccount(savingsAccount); + + //deposit and withdraw from accounts + checkingAccount.deposit(100.0); + savingsAccount.deposit(1000.0); + savingsAccount.withdraw(200.0); + + //check summary + assertEquals("CHECKING: 100.0\n" + + "SAVINGS: 1000.0,-200.0\n" + + "MAXI_SAVINGS:", + jack.getTransactions() + ); + } + + + + } From ff4970b2035e8e7558885119f459f3ddc383455e Mon Sep 17 00:00:00 2001 From: foyaz-95 <50546819+foyaz-95@users.noreply.github.com> Date: Sun, 12 May 2019 14:55:31 +0100 Subject: [PATCH 4/5] test submission From f3f8ee7dd3ec7c554b5f333379c8a67d0c3337c7 Mon Sep 17 00:00:00 2001 From: foyaz-95 <50546819+foyaz-95@users.noreply.github.com> Date: Sun, 12 May 2019 14:56:12 +0100 Subject: [PATCH 5/5] test submission --- README.md | 97 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index a1cd00ea..797715d7 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,55 @@ -Programming Test -======== - -This is a dummy application to be used as part of a software development interview. - -instructions --------- - -* Treat this code as if you owned this application, do whatever you feel is necessary to make this your own. -* There are several deliberate design, code quality and test issues that should be identified and resolved. -* Below is a list of the current features supported by the application; as well as some additional features that have been requested by the business owner. -* In order to work on this take a fork into your own GitHub area; make whatever changes you feel are necessary and when you are satisfied submit back via a pull request. See details on GitHub's [Fork & Pull](https://help.github.com/articles/using-pull-requests) model -* Be sure to put your name in the pull request comment so your work can be easily identied. -* The project uses maven to resolve dependencies however if you want to avoid maven configuration the only external JAR that's required is junit-4.11. -* Refactor and add features (from the below list) as you see fit; there is no need to add all the features in order to "complete" the exercise. Keep in mind that code quality is the critical measure and there should be an obvious focus on testing. -* You'll notice there is no database or UI; these are not needed - the exercise deliberately avoids these requirements. -* REMEMBER: this is YOUR code, make any changes you feel are necessary. -* You're welcome to spend as much time as you like. -* The code will be a representation of your work, so it's important that all the code--new and pre-existing--is how you want your work to be seen. Please make sure that you are happy with ALL the code. - -abc-bank --------- - -A dummy application for a bank; should provide various functions of a retail bank. - -### Current Features - -* A customer can open an account -* A customer can deposit / withdraw funds from an account -* A customer can request a statement that shows transactions and totals for each of their accounts -* Different accounts have interest calculated in different ways - * **Checking accounts** have a flat rate of 0.1% - * **Savings accounts** have a rate of 0.1% for the first $1,000 then 0.2% - * **Maxi-Savings accounts** have a rate of 2% for the first $1,000 then 5% for the next $1,000 then 10% -* A bank manager can get a report showing the list of customers and how many accounts they have -* A bank manager can get a report showing the total interest paid by the bank on all accounts - -### Additional Features - -* A customer can transfer between their accounts -* Change **Maxi-Savings accounts** to have an interest rate of 5% assuming no withdrawals in the past 10 days otherwise 0.1% -* Interest rates should accrue and compound daily (incl. weekends), rates above are per-annum +Programming Test +======== + +This is a dummy application to be used as part of a software development interview. + +instructions +-------- + +* Treat this code as if you owned this application, do whatever you feel is necessary to make this your own. +* There are several deliberate design, code quality and test issues that should be identified and resolved. +* Below is a list of the current features supported by the application; as well as some additional features that have been requested by the business owner. +* In order to work on this take a fork into your own GitHub area; make whatever changes you feel are necessary and when you are satisfied submit back via a pull request. See details on GitHub's [Fork & Pull](https://help.github.com/articles/using-pull-requests) model +* Be sure to put your name in the pull request comment so your work can be easily identied. +* The project uses maven to resolve dependencies however if you want to avoid maven configuration the only external JAR that's required is junit-4.11. +* Refactor and add features (from the below list) as you see fit; there is no need to add all the features in order to "complete" the exercise. Keep in mind that code quality is the critical measure and there should be an obvious focus on testing. +* You'll notice there is no database or UI; these are not needed - the exercise deliberately avoids these requirements. +* REMEMBER: this is YOUR code, make any changes you feel are necessary. +* You're welcome to spend as much time as you like. +* The code will be a representation of your work, so it's important that all the code--new and pre-existing--is how you want your work to be seen. Please make sure that you are happy with ALL the code. + +abc-bank +-------- + +A dummy application for a bank; should provide various functions of a retail bank. + +### Current Features + +* A customer can open an account +* A customer can deposit / withdraw funds from an account +* A customer can request a statement that shows transactions and totals for each of their accounts +* Different accounts have interest calculated in different ways + * **Checking accounts** have a flat rate of 0.1% + * **Savings accounts** have a rate of 0.1% for the first $1,000 then 0.2% + * **Maxi-Savings accounts** have a rate of 2% for the first $1,000 then 5% for the next $1,000 then 10% +* A bank manager can get a report showing the list of customers and how many accounts they have +* A bank manager can get a report showing the total interest paid by the bank on all accounts + +### Additional Features + +* A customer can transfer between their accounts +* Change **Maxi-Savings accounts** to have an interest rate of 5% assuming no withdrawals in the past 10 days otherwise 0.1% +* Interest rates should accrue and compound daily (incl. weekends), rates above are per-annum + +### Features Implemented +* A customer can open an account +* A customer can deposit / withdraw funds from an account +* A customer can request a statement that shows transactions and totals for each of their accounts +* Different accounts have interest calculated in different ways + * **Checking accounts** have a flat rate of 0.1% + * **Savings accounts** have a rate of 0.1% for the first $1,000 then 0.2% + * **Maxi-Savings accounts** have a rate of 2% for the first $1,000 then 5% for the next $1,000 then 10% +* A bank manager can get a report showing the list of customers and how many accounts they have +* A bank manager can get a report showing the total interest paid by the bank on all accounts +* A customer can transfer between their accounts +* Interest rates should accrue and compound daily (incl. weekends), rates above are per-annum \ No newline at end of file