Project 9-2 Account Balance Calculator
Project 9-2: Account Balance Calculator
Create an application that calculates and displays the starting and ending monthly balances for a checking account and a savings account.
Console
Welcome to the Account application
Starting Balances
Checking: $1,000.00
Savings: $1,000.00
Enter the transactions for the month
Withdrawal or deposit? (w/d): w
Checking or savings? (c/s): c
Amount?: 500
Continue? (y/n): y
Withdrawal or deposit? (w/d): d
Checking or savings? (c/s): s
Amount?: 200
Continue? (y/n): n
Monthly Payments and Fees
Checking fee: $1.00
Savings interest payment: $12.00
Final Balances
Checking: $499.00
Savings: $1,212.00
Specifications
Create interfaces named Depositable, Withdrawable, and Balanceable that specify the methods that can be used to work with accounts. The Depositable interface should include this method:
void deposit(double amount)
The Withdrawable interface should include this method:
void withdraw(double amount)
And the Balanceable interface should include these methods:
double getBalance()
void setBalance(double amount)
Create a class named Account that implements all three of these interfaces. This class should include an instance variable for the balance.
Create a class named CheckingAccount that inherits the Account class. This class should include an instance variable for the monthly fee that’s initialized to the value that’s passed to the constructor. This class should also include methods that subtract the monthly fee from the account balance and return the monthly fee.
Create a class named SavingsAccount that inherits the Account class. This class should include instance variables for the monthly interest rate and the monthly interest payment. The monthly interest rate should be initialized to the value that’s passed to the constructor. The monthly interest payment should be calculated by a method that applies the payment to the account balance. This class should also include a method that returns the monthly interest payment.
Create a class named AccountBalanceApp that uses these objects to process and display deposits and withdrawals.
Use the Console class presented in chapter 7 or an enhanced version of it to get and validate the user’s entries. Don’t allow the user to withdraw more than the current balance of an account.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.