In this program, you will design a pseudo ATM interface. Accounts can be created, accessed, and closed later. Each customer can create at least two different accounts, checking and saving. There will be an interest rate associated with each type of account. The valid transactions are deposit, withdraw, transfer, and balance.
Account initially will be created with a deposit and a creation date. Thereafter, money can be deposited, withdrawn, or transferred. Balance will be updated accordingly. Appropriate error checking should also be enforced such as not enough money to be withdrawn or transferred, account does not exist, or accounts have been closed.
Checking accounts have an interest rate of 1%, compounded monthly. Saving accounts have an interest rate of 5%, compounded quarterly (i.e. every 3 months). The bank should have the ability to query the amount of interest paid to an account during a given year.
Money can be deposited to either type of accounts, but money can only be withdrawn from checking. It is valid to transfer money from saving to checking and vice versa. A request for balance should display each individual account balance as well as the total balance of all accounts owned (balance should include interest).
You should at least have a customer class, an account class, and an interest class.
customer class should at least contain:
You need to think about where the appropriate methods (e.g. the transactions) should go also.
You can assume creation date consists of only the month and the year. Interests are calculated base on the intial deposit, and the subsequent transactions during the execution of the program do not need to be taken into consideration in the interest calculation. You are allowed to hard code the current month and year to be 5/98 if you do not know how to get that from the system.
Commands will be done through standard input.
create 123 check 1000 9/97 deposit 123 check 500 create 123 save 1000 1/98 transfer 123 save check 100 withdraw 123 100 balance 123 bank 123 check 97 close 123 quitIf the executable is called "atm", then after executing "atm < data.in", the output to standard output should be (obviously, your output should not contain the comments):
checking: $1006.68 /* 9/97 thru 4/98 => 8 months */ checking: $1506.68 saving: $1012.50 /* 1/98 thru 4/98 => 1 3-month compound period */ checking: $1606.68 saving: $912.50 checking: $1506.68 checking: $1506.68 saving: $912.50 total: $2419.18 $3.34 interest paid in 97 /* 9/97 thru 12/97 => 4 months interest paid */ Accounts closed with $2419.18
What we are looking for is a working program and evidence that you have utilized some of the concepts of object-oriented programming. In that we mean you should have at least the following: a clear number of objects (at least the ones stated above) and the use of multiple inheritance.
We will be using g++ on acme to compile your programs. If for any reasons you would want to use another compiler, please talk with May.
Assuming that you have followed my previous instructions on setting up your account for viewgrades, you may follow the steps below to turn in your project.
Log onto acmexYou do not need to turnin your executable. And for double checking, after you do the turnin, go to a different directory away from where your original program files reside, type "getback prj2". You should get your files back from the system. Make sure they are the same as your originals.
Any questions regarding this project should be directed to May.