Problem Description: (The Account class) Design a class named Account that contains: · A constructor that creates
Posted: Mon Jul 11, 2022 9:56 am
Problem Description:
(The Account class) Design a classnamed Account that contains:
· A constructor thatcreates an account with the specified private "id", "balance", and"annualInterestRate".
· A method named"withdraw" withdraws a specified amount from the account andchecks if the amount is less than the balance or not. If the amountis less, it prints ("Not allowed. Withdraw a sum less than thebalance.")
· A methodnamed deposit that deposits a specified amount to theaccount.
· A methodnamed getMonthlyInterestRate() that returns the monthlyinterest rate *(by dividing it by the number of months in theyear.).
· A method named getMonthlyInterest()returns the monthly interest *(by multiplying the balance by theMonthlyInterestRate).
(The Account class) Design a classnamed Account that contains:
· A constructor thatcreates an account with the specified private "id", "balance", and"annualInterestRate".
· A method named"withdraw" withdraws a specified amount from the account andchecks if the amount is less than the balance or not. If the amountis less, it prints ("Not allowed. Withdraw a sum less than thebalance.")
· A methodnamed deposit that deposits a specified amount to theaccount.
· A methodnamed getMonthlyInterestRate() that returns the monthlyinterest rate *(by dividing it by the number of months in theyear.).
· A method named getMonthlyInterest()returns the monthly interest *(by multiplying the balance by theMonthlyInterestRate).