Question: Program in Java**** Create the external CheckAcct class that contains: A private int data field named id for the account. A private double data field
Program in Java****
Create the external CheckAcct class that contains:
A private int data field named id for the account.
A private double data field named balance for the account.
A private double static data field named annualInterestRate that stores the current interest rate.
A private Date data field named dateCreated that stores the date when the account was created.
A constructor that creates an account with the specified id and initial balance.
Accessor methods (get) for id, balance and annualInterestRate.
A mutator method (set) for annualInterestRate.
The accessor method for dateCreated.
A method named getMonthlyInterest() that returns the monthly interest rate.
A method named withdraw that withdraws a specified amount from the account.
A method named deposit that deposits a specified amount from the account.
***Do not modify the driver class****
***The Driver class is :
import java.util.Scanner;
import java.text.DecimalFormat;
public class BankAcctDemo {
public static void main (String[] args) {
int acctID;
double acctBalance, annIntRate, withAmt, depAmt;
Scanner input = new Scanner(System.in);
DecimalFormat twoDigits = new DecimalFormat("$###,###.00");
DecimalFormat percent = new DecimalFormat("##.00%");
System.out.println(" Bank Account Balance");
System.out.println();
System.out.print("Enter your account id: ");
acctID = input.nextInt();
System.out.println();
System.out.print("Enter your current Balance: ");
acctBalance = input.nextDouble();
System.out.println();
System.out.print("Enter your annual interest rate: ");
annIntRate = input.nextDouble();
System.out.println();
System.out.print("Enter any withdrawals: ");
withAmt = input.nextDouble();
System.out.println();
System.out.print("Enter any deposits: ");
depAmt = input.nextDouble();
System.out.println();
CheckAcct account = new CheckAcct(acctID, acctBalance);
CheckAcct.setAnnualInterestRate(annIntRate);
account.withdraw(withAmt);
account.deposit(depAmt);
System.out.println("Balance for account # " + account.getId() + " is " +twoDigits.format(account.getBalance()));
System.out.println("Monthly interest is " + twoDigits.format(account.getMonthlyInterest()));
System.out.println("This account was created at " +
account.getDateCreated());
System.out.println();
System.out.println();
System.out.println("Annual interest rate is " + percent.format(CheckAcct.getAnnualInterestRate()));
}
}
*****Sample output******

CAWINDOWSLsystem32 cmd exe Bank Account Balance Enter your account id: 1122 Enter your current Balance: 20800 Enter your annual interest rate: .845 Enter any withdrawals: 2588 Enter any deposits: 388 Balance for account # 1122 is $17,800.00 Monthly interest ia $66.5 his account was created at Wed Nov 82 11:85:82 EDT 2816 nnual interest rate is 4.58 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
