Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Monthly Balance The application begins by displaying the starting balance for a checking account. The application prompts the user to enter the amount for

Java Monthly Balance

The application begins by displaying the starting balance for a checking account.

The application prompts the user to enter the amount for a withdrawal or deposit.

When the user finishes entering deposits and withdrawals, the application displays the fees for the month followed by the final balances for the month

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. In addition, it should supply a method like the following method that returns a balance that has been formatted as currency:

String getBalanceFormatted()

Create a class named CheckingAccount that inherits the Account class. This class should include an instance variable for the monthly fee and these methods:

void subtractMonthlyFee()

void setMonthlyFee(double monthlyFee)

double getMonthlyFee()

String getMonthlyFeeFormatted()

By default, the monthly fee for a checking account should be $1.

Create a class named Transactions that contains the following static methods for depositing and withdrawing funds from either type of account:

public static void deposit(Depositable account, double amount) {

account.deposit(amount);

}

public static void withdraw(Withdrawable account, double amount) {

account.withdraw(amount);

}

Create a class named AccountApp that prompts the user for a transaction, posts the transaction, and displays the information shown in the console output. Create the necessary objects for each transaction, and post the transaction using the appropriate method of the Transactions class.

Use the Console class presented in chapter 8 or a variation of it to get entries from the user.

This application should not allow the user to withdraw more than the current account balance.

This application should not allow the user to deposit more than $10,000 per transaction.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions