Question: Due date: November 2 For this assignment you are to develop a class that models a bank account. As part of the class definition, create
Due date: November 2 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 cach individual bank account, the class should be able to keep track of the: . account number current balance interest ratc Each bank account should have its own unique account number assigned to it when the 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" ctc. The class should be designed to ensure that no two accounts are ever assi same account number gned the A constructor for the class should be provided that allows values to be specified for the current balance and interest rate when a new account is created. The constructor also assign a unique account number to cach new account as it is ereated should A toStringl ) method for the class should be provided that returns a reasonable string representation of a bank account including the account number, current balance, and interest 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 , After the bank account class has been established, write a main ) method that creates s (or more) new bank account objects giving cach 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 //oz r2 w
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
