Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, This question is long but answer is simple . This BankAccount program. pleas

ID: 3627064 • Letter: H

Question

Hi,

This question is long but answer is simple . This BankAccount program.
please post answer for this...Thanks

Create an abstract class BankAcct in the myclasses package. You will need to import java.text.DecimalFormat
Create two instance variables: acctNbr (int) and balance (double). Both are private, with public getter and protected setter methods.
There should be no default constructor.
Create a constructor with parameters acctNbr (int) and balance (double). Use the setter methods to initialize the instance variables.
Create the toString() to print the acctNbr and balance as follows: Acct nbr xxx has balance $xxx.xx
Create the public method deposit() with parameter amount (double) which utilizes the accessor methods to add amount to balance. The deposit() method has a return type of void.
Create the public method withdraw() with parameter amount (double) which utilizes the accessor methods to subtract amount from balance. The withdraw() method has a return type of void.
Declare a public abstract void method monthEnd( ). This method will be implemented by the subclasses (discussed later).
Create a class SvgsAcct in the myclasses package which extends BankAcct. Be sure to check the "Constructors from superclass" and "Inherited abstract methods" check boxes.
Create a private static variable interestRate (double) with public getter and setter methods and an initial value of .04 (Note: this is not final.)
Complete the monthEnd( ) stub generated RAD. This method calculates the monthly interest and uses the accessor methods to add that interest to the balance. Round to two decimal places. Calculation is: monthly interest = balance * interestRate / 12
Create a class ChkgAcct in the myclasses package which extends BankAcct. Be sure to check the "Constructors from superclass" and "Inherited abstract methods" check boxes.
Create a private static variable monthlyFee (double) with public getter and setter methods and an initial value of 3.00 (Note: this is not final.)
Create a private static variable perCheckFee (double) with public getter and setter methods and an initial value of .15 (Note: this is not final.)
Create a private instance variable nbrOfChecks (int) (not static) with public getter and private setter methods and an initial value of zero.
Create a public void method withdraw() with parameter amount (double) which uses the accessor methods to (1) subtract amount from balance and (2) add 1 to nbrOfChecks
Complete the monthEnd() stub generated by RAD. This method uses the accessor methods to (1) calculate the total monthly fee based on monthlyFee, perCheckFee, and nbrOfChecks, (2) subtracts the total monthly fee from the balance, and (3) resets nbrOfChecks to zero.
Create a class TestBankAcct with main(). Reminder: This does not "extend". Import SvgsAcct and ChkgAcct.
Instantiate as follows…
Create an instance of SvgsAcct with account number 111 and opening balance of $300.00
Create an instance of ChkgAcct with account number 222 and opening balance of $500.00
Create another instance of a ChkgAcct with account number 333 and opening balance of $600.00
Print all accounts using toString( ) method
Process first month transactions:
deposit $100.00 to account 111
withdraw $250.00 from account 111
deposit $150.00 to account 222
withdraw $100.00 from account 222
withdraw $200.00 from account 222
deposit $100.00 to account 333
deposit $150.00 to account 333
withdraw $50.00 from account 333
Invoke the monthEnd() method for all accounts to update balance with interest or fees
Print all accounts using toString() method
Continuing with TestBankAcct...process fee changes:
change savings account interest rate to .05
change checking account monthly fee to $5.00
change checking account per check fee to $.18
Process second month transactions:
deposit $750.00 to account 111
withdraw $400.00 from account 111
withdraw $50.00 from account 111
withdraw $100.00 from account 111
deposit $300.00 to account 222
withdraw $50.00 from account 222
withdraw $60.00 from account 222
withdraw $70.00 from account 222
withdraw $10.00 from account 333
Invoke the monthEnd( ) method for all account to update balance with interest or fees.
Print all accounts using toString( ) method.
Save and run. Results should be as shown on next slide...

Explanation / Answer

Account.java public abstract class Account { int accountNumber; double accountBalance; public Account(int an) { accountNumber = an; accountBalance = 0.0; } public void setBalance(double bal) { accountBalance = bal; } public abstract int getNumber(); public abstract double getBalance(); public abstract void getInfo(); } Checking.java public class Checking extends Account { public Checking(int a) { super(a); } public void getInfo() { System.out.println("Checking Account Information " + getNumber() + " $" + getBalance()); } public int getNumber() { return accountNumber; } public double getBalance() { return accountBalance; } } Saving.java public class Savings extends Account { double rate; public Savings(int a, double r) { super(a); rate = r; } public void getInfo() { System.out.println("Savings Account Information " + getNumber() + " $" +getBalance() + " rate " + rate); } public int getNumber() { return accountNumber; } public double getBalance() { return accountBalance; } } Write a program named Account Array in which you enter data for a mix of 10 Checking and Saving accounts. Use a for loop to display the data. AccountArray.java public class AccountArray { public static void main(String[] args) { Account someAccts[] = new Account[10]; int i; someAccts[0] = new Checking(101); someAccts[1] = new Savings(201, 2.1); someAccts[2] = new Checking(102); someAccts[3] = new Savings(202, 2.2); someAccts[4] = new Checking(103); someAccts[5] = new Savings(203, 2.3); someAccts[6] = new Checking(104); someAccts[7] = new Savings(204, 2.4); someAccts[8] = new Checking(105); someAccts[9] = new Savings(205, 2.5); for(i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote