Example 1

Design a class Account1 to simulate simplified bank account. An account can be opened by providing account-holder’s name and social security number (ssn).  Such an account has zero balance at the beginning. The other way to open an account is to provide initial balance in addition to account holder’s name and ssn.  The functionality of the class should include depositing and withdrawing a given amount of money and printing report about the current state of the account.  For depositing there are no restrictions.  Any amount of money can be added to the account.  The withdrawal, on the other side is only permitted if sufficient funds exist on the account.  If a withdrawal is requested in the case of insufficient funds an error message is printed and balance remains unchanged. If a withdrawal or deposit are performed a message is printed  to indicate the activity performed. Report should provide the information about the current status of the account. It prints name and ssn for the account holder and current balance. Design a separate class to test the account class. A demo should open few accounts and simulate random activity for each account.  Few withdrawals and deposits should be made for each account and status report should be printed daily.