Assignment 2
Problem Statement
Write a program that provides personal banking applications to a user.
It is expected that you will reuse the Date and
DateCalculator classes you developed in the last project.
The minimal set of services this program should provide are :
- Deposit amounts of money
- Withdraw amounts of money
- Provide information about account balance
Business Rules
- Whenever a deposit or a withdrawal transaction is made, the
balance amount should be updated to reflect the interest earned
from the date of the last transaction until the date of the
current transaction.
- This implies you will need to employ date arithmetic to compute the
'age' of each transaction. Your program must test for leap years. In a
leap year february will have 29 days
- Your application must validate dates
for chronological correctness. In other words, each succeeding
transaction must occur on the same date or later than the preceeding
transaction
- After the balance has been brought up-to-date, deposit or
withdrawal amounts should be applied against the balance
- The current balance must be displayed after each transaction is
completed
- Overdrafts are not permitted. In other words, withdrawals of
amounts that exceed the current balance are not permitted.
In such cases an error message must be displayed and the transaction
must be aborted
- The first transaction is a deposit that establishes the
starting balance amount. Assume an annual interest rate of 5%
- Interest is compounded daily; i.e., Interest is earned
each day and is added to the balance on that day. This balance then
becomes the starting balance on the next day, on which interest is
earned, and so on
Design Guidelines
You may design your application using the following class:
class Account{
private:
float Balance; // Current Balance amount
Date LastTransaction; // Date of last transaction
updateBalance(); // Compute interest; add to Balance
// other relevant data members and member functions
public:
menu(); // menu of service options
deposit(); // deposit amounts
withdraw(); // withdraw amounts
inquire(); // balance inquiry
// All additional relevant member functions, including
// constructors, Transaction getters, Transaction setters,
// Transaction displayers
};
Your main() function should only consist of the
following:
int main(){
Account myAccount;
return(0);
}
Submitting Your Programs
Name your program files asg2.h asg2.C, and
asg2_main.C. Copy them to your subdirectory under
/accounts/classes/subraman/ba6806/. Please enable read
permissions on your files.
The program is due on April 7, 2005
Grades...