Question: Java programming Create a class called BankAccount Each Account object should have a name, ID, accountType (Savings, Chequing and TFSA) and amount to be deposited

 Java programming Create a class called BankAccount Each Account object should

Java programming

Create a class called BankAccount Each Account object should have a name, ID, accountType (Savings, Chequing and TFSA) and amount to be deposited for Initial opening of the account. (Hint: accountType can be a String Array]. Create 2 constant values which depict the INTEREST SAVINGS YEARLY=2.1% and INTEREST_TFSA_YEARLY=2.3%. Create a default constructor with empty arguments and a constructor so that it only accepts 2 parameters, i.e., name and amount. Initialize the ID with value between 1 to 1000 using randint() method from the Random Class. Create Set/ Get methods for as required for each field. Create 2 methods to Deposit and Withdraw money from the account respectively. Create a Method Yearly_Interest. Depending on the account type, the interest will be different. All must be calculated from one single method. Create a toString() method to print the values of name, ID, AccountType, amount in the account, interest earned in the year

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!