Just one programming problem.
Have the following classes in a file called ATM.java. ATM: CashDispenser, DepositUnit, ReceiptPrinter, CardReader, IOUnit and Atm. Note that only Atm class will be public in this file. The interfaces of these classes remain the same.
Implement the following methods as follows:
readCard() of CardReader asks for the card number from the user, reads it and returns it.
handleTransaction() of ATM:
a) Ask the user to enter the pin. Verify the pin via the verify() method of the bank. If the pin is verified, continue with the transaction. Allow user to enter the pin number up to three times. After the three trials, if the user cannot provide the correct pin, confiscate the card and finish the transaction.
b) Now that BankServer methods will be implemented, handleTransaction should change accordingly. For example, after a deposit, it should print the total amount in the account. Also, before a withdraw, it should verify the availability of funds via the new BankServer method verifyBank().
Have the following classes in a file named BankServer.java. Account, SavingsAccount, CheckingAccount and BankServer where only BankServer is a public class. You will define Java classes for Account, SavingsAccount and CheckingAccount concepts. applyMonthlyInterest() will calculate the monthly interest and add it to the balance. Implement deposit() method in CheckingAccount class, lastDepositDate and lastDepositAmount fields are updated.
The existing public interface of the BankServer class remain the same. You need to introduce private loadAccounts() and public verifyFunds() methods. You should implement the methods as described below:
• loadAccounts() reads a input file that contains the account information and create
the account objects. A sample input file is shown below
S|11111|22221|3333|1000|2.2
C|11112|22222|3333|5000|102.5|2005|8|12|11|32
The first field is either an S for a savings account or a C for a checking account. The
remaining fields for savings account are account id, customer id, pin, balance and
interest rate. Other fields for checking account are account id, customer id, pin,
balance, amount of last deposit, year, month, day, hour and minutes of the last deposit
date. loadAccount() should read this file and create account objects. Call this method
in the constructor of BankServer with the name of the input file.
• verifyFunds() method, you will search for the account and if it exists make sure its
balance is greater than or equal to the amount. In all of the BankServer methods, use
the account number that you read with readCard() method of the IOUnit class as the
key for searching the accounts.
Implement all other necessary methods described in UML diagram as needed to
compile and run your program.
Create ManageBankAccounts.java and define a main function that creates a bank server
object and an ATM object. Call the handleTransaction() method on the ATM object.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more