Question: For this assignment you are to develop a class that models a bank account. As part of the class definition, create instance variables and class

 For this assignment you are to develop a class that modelsa bank account. As part of the class definition, create instance variables

For this assignment you are to develop a class that models a bank account. As part of the class definition, create instance variables and class (static) variables as required. For each individual bank account, the class should be able to keep track of the: account number e current balance interest rate account numbe r assigned to it when the Each bank account should have its own unique account is created. Account numbers should be integer values ranging from 1000 - 9999. The first account created should be assigned the number "1000", the second should be assigned the number" 1001, the third should be assigned the number" 1002", etc. The class should ensure that no two accounts are assigned the same account number A constructor for the class should be provided that allows values to be current balance and interest rate when a new account is created. The constructor should specified for the also assign a unique account number to each new account as it is created A toString) method for the class should be provided that returns a reasonable string representation of a bank account including the account number, current balance, and nterest rate Additionally, methods should be provided for the class that allow: a deposit to be made to an account a withdrawal to be made from an account the balance for an account to be retrieved the interest rate for an account to be retrieved the account number of an account to be retrieved e e After the bank account class has been established, write a main) method that creates 5 (or more) new bank account objects giving each different values for the current balance and interest rate as they are created. Print each of the objects to display the balance and interest rate values, and also to verify that each account receives a unique account number as it is created

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!