Hi, there! I have an assignment for one of my courses which requires me to create a program in Java using classes:
Quote:
Create an ATM class which will mimic a bank machine in the real world as much as possible. The ATM should have the ability to deposit money, withdraw money, display the current balance, and add daily interest. It should also have a constructor which would take a bank name (i.e., BMO, Royal Bank, etc.) and an initial balance amount as parameters. The MyBankMachine program should have a menu which allows you to interact with the ATM object. The user should be able to use all the features of the ATM object, including the daily interest feature. Each of these features should have error guards to prevent the user from invalid inputs. For example, the user should not be allowed to deposit -$200 into the account.
When calculating daily interest, the formula to use is the compound interest formula. The formula is:
A = P(1 + i)^n
A = final amount
P = principal amount
i = interest rate per compound period
n = number of compound periods
The daily interest feature should ask the user the amount of the annual interest rate, as well as the number of days to leave the balance invested. It should then add the interest to the current balance.
How would I go about doing this? Thank you!