Write a superclass Account (protected id and balance; deposit, boolean withdraw that refuses non-positive amounts or more than the balance, an empty monthEnd(), toString() → S-1 1250.00) and two subclasses:
SavingsAccount(id, balance, annualRate)—withdrawrefuses anything that would leave less thanMINIMUM = 100, otherwise it callssuper.withdraw;monthEnd()adds one month of interest (balance × rate / 100 / 12).CheckingAccount(id, balance, overdraftLimit)—withdrawmay go below zero down to−overdraftLimitand counts withdrawals;monthEnd()chargesFEE = 2per withdrawal beyond the first three, then resets the counter.
BankBranch.main reads the savings balance and rate, the checking balance and overdraft, then operations D S-1 200, W C-1 50, M (month end) until the end of input. Refused withdrawals print refused: withdraw 500.00 from S-1. Finally print both accounts (Savings S-1 …, Checking C-1 …).