Practical
14) BankAccount Class Definition and Creation:
Design and develop a class for called BankAccount1, which has some common characteristics in typical bank account. Assume that it is normal savings account.
o Account Number (String)
o Account Holder Name (String)
o Balance (Double)
o Account State (String) (for later use only)
o Takes all above fields as parameter
o Accessor
o Mutator
o Service methods :
▪ Withdraw (double amount) – cannot withdraw more than balance
▪ Deposit(double amount)
▪ TransferTo (BankAccount a, double amount)
o Support methods (if required)
a. Create a driver program that tests the above program.
The driver should create an account with given properties and test the working.
What concepts have we learnt in Question One?
➢ Class design
➢ Programming classes in Java.

WhatsApp us