Question: public class Main { public static void main ( String [ ] args ) { / / Create a checking account instance with initial balance,

public class Main {
public static void main(String[] args){
// Create a checking account instance with initial balance, credit limit, and overdraft fee
CheckingAccount checkingAccount = new CheckingAccount(10000,5000,2000);
// Display initial account info
System.out.println("Initial Account Info:
"+ checkingAccount.accountInfo());
// Perform debit transaction exceeding balance
checkingAccount.debit(12000); // Exceeding balance by $2000, overdraft fee applied
checkingAccount.applyInterest(); // No interest applied
System.out.println("Account Info after Debit:
"+ checkingAccount.accountInfo());
// Perform credit transaction
checkingAccount.credit(3000); // Adding $3000 to balance
checkingAccount.applyInterest(); // No interest applied
System.out.println("Account Info after Credit:
"+ checkingAccount.accountInfo());
}
}

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!