Home / Expert Answers / Computer Science / in-java-problem-description-and-given-info-you-must-write-a-public-class-named-checkingaccount-with-pa687

(Solved): in java Problem Description and Given Info You must write a public class named checkingAccount with ...



student submitted image, transcription available belowstudent submitted image, transcription available below

in java

Problem Description and Given Info You must write a public class named checkingAccount with fields and methods as defined below, and that inherits from (extends) the BankAccount class. Structure of the Fields As described by the UML Class Diagram above, your CheckingAccount class must have the following fields: - a private field named overdraftFee of type int initialized to Structure of the Methods As described by the UML Class Diagram above, your CheckingAccount class must have the following methods: - a public method named debit that takes an int argument and returns a boolean - a public method named setFee that takes an int and returns nothing - a public method named getFee that takes no arguments and returns an int - a public method named applyInterest that takes no arguments and returns nothing - a public method named accountInfo that takes no arguments and returns a String Note that three of these methods are defined as abstract in the BankAccount base class. You will be overriding and implementing these methods in this checkingAccount concrete derived class. Behavior of the Methods - The debit method should subtract the argument amount from the balance. The debit method should always return true. - The setFee method should store the argument amount in the overdraftFee field. - The getFee method should return the value stored in the overdraftFee field. - The applyInterest method should compute the interest amount and add this amount to the balance, but only if the balance is greater than . - The accountInfo method will return a string formatted exactly like this: Additional Information BankAccount Class Copy and paste your BankAccount class code from your Bank Account (Individual Assignment) into the BankAccount. Java file in the editor below. All Bank Accounts 1. All accounts have balance, credit and debit amounts, and fees stored and passed as a number of pennies (int). 2. All debit amounts will be subtracted from the balance, and all credit amounts will be added to the balance. 3. All bank accounts have a non-negative interest rate ( 0.02 would be a interest rate). 4. When applying interest, interest amount is calculated by multiplying the balance by the interest rate. 5. When applying interest, interest amount is always added to the balance, and any fractional part will be rounded down. 6. Interest will not be applied to any Savings or Checking account with a balance of zero or less. 7. Debit methods will return false if the transaction cannot be made because of insufficient balance or insufficient credit limit. Otherwise they will return true. 8. The credit method will always return true. Checking Accounts 1. A CheckingAccount can have a negative balance. - The debit method for the CheckingAccount will always return true. 2. Any CheckingAccount debit that ends with a negative balance will incur an overdraftFee (i.e. the overdraftFee amount will be subtracted from the balance). A checkingAccount debit will always succeed. 3. Interest will not be applied to a CheckingAccountwith a negative balance.


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe