Question

In: Computer Science

Create an application that calculates and displays the starting and ending monthly balances for a checking...

Create an application that calculates and displays the starting and ending monthly balances for a checking account and a savings account.

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.

  • 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.

sorry to bother i really appreciate the help could you explain step by step please and thank you.

Solutions

Expert Solution

Thanks for the question, the entire assignment is too large to be completed in the given time. I have written the following interfaces and classes, Can you please post a separate question asking to code the AccountBalanceApp and the Console class

For now you go through the code and try to understand, comments given as you requested.

=====================================================================

public interface Depositable {
    void deposit(double amount);
}

=====================================================================

public interface Withdrawable {

    void withdraw(double amount);
}

=====================================================================
​​​​​​​

public interface Balanceable {

    double getBalance();

    void setBalance(double amount);
}

=====================================================================
​​​​​​​

//Create a class named Account that implements all three of these interfaces.
public class Account implements Depositable, Withdrawable, Balanceable {


    //instance variable balance;
    private double balance;

    public Account() {
        balance = 0.0;
    }

    public Account(double balance) {
        this.balance = balance;
    }


    @Override
    public double getBalance() {
        return balance;
    }

    @Override
    public void setBalance(double amount) {
        balance = amount;
    }

    @Override
    public void deposit(double amount) {
        balance += amount;
    }

    @Override
    public void withdraw(double amount) {
        balance -= amount;
    }
}

=====================================================================
​​​​​​​

//Create a class named CheckingAccount that inherits the Account class.
public class CheckingAccount extends Account {



    private double monthlyFees;


    public CheckingAccount(double monthlyFees) {
        this.monthlyFees = monthlyFees;
    }

    public CheckingAccount(double balance, double monthlyFees) {
        super(balance);
        this.monthlyFees = monthlyFees;
    }

    // //This class should also include methods that subtract
    // // the monthly fee from the account balance and return the monthly fee.
    public double deductMonthlyFees() {

        withdraw(monthlyFees);
        return monthlyFees;
    }
}

=====================================================================
​​​​​​​

//Create a class named SavingsAccount that inherits the Account class.
public class SavingsAccount extends Account {

    private double monthlyInterestRate;
    private double interestPayment;

    //The monthly interest rate should be initialized to the value that’s passed to the constructor.
    public SavingsAccount(double monthlyInterestRate) {
        this.monthlyInterestRate = monthlyInterestRate;
    }

    //The monthly interest rate should be initialized to the value that’s passed to the constructor.
    public SavingsAccount(double balance, double monthlyInterestRate) {
        super(balance);
        this.monthlyInterestRate = monthlyInterestRate;
    }

// The monthly interest payment should be calculated by a method that applies the
​​​​​​​// payment to the // account balance.
    public void addInterest(){
        deposit(getBalance()*monthlyInterestRate);
    }
 
     //This class should also include a method that returns the monthly interest payment.
    public double getMonthlyInterestPayment() {
        return interestPayment;
    }
}

=====================================================================
​​​​​​​


Related Solutions

Create an application that calculates and displays the amount of a homeowner’s property tax. The tax...
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax is 1.35% of the property’s assessed value, which will be entered by the user. a. Prepare a Planning Chart for the application. b. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines covered in the chapter. The guidelines are summarized in Figure 2-20. (If you want to include an image in the interface, you can either use your...
In C# Create a GUI application that calculates and displays the total travel expenses of a...
In C# Create a GUI application that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: Number of days on the trip Amount of airfare, if any Amount of car rental fees, if any Number of miles driven, if a private vehicle was used Amount of parking fees, if any Amount of taxi charges, if any Conference or seminar registration fees, if any Lodging charges, per...
Create a GUI application in C# that calculates and displays the total travel expenses of a...
Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of taxi charges, if any • Conference or seminar...
You've been hired by Yogurt Yummies to write a C++ console application that calculates and displays...
You've been hired by Yogurt Yummies to write a C++ console application that calculates and displays the cost of a customer’s yogurt purchase. Use a validation loop to prompt for and get from the user the number of yogurts purchased in the range 1-9. Then use a validation loop to prompt for and get from the user the coupon discount in the range 0-20%. Calculate the following:         ● Subtotal using a cost of $3.50 per yogurt.         ● Subtotal...
Create a PowersTable application that displays a table of of powers. ( Java Programing )
Create a PowersTable application that displays a table of of powers. ( Java Programing )
Create a CubesSum application that prompts the user for a non-negative integer and then displays the...
Create a CubesSum application that prompts the user for a non-negative integer and then displays the sum of the cubes of the digits.   b) Modify the application to determine what integers of two, three, and four digits are equal to the sum of the cubes of their digits.(Java Programming )
Create an Investment application that calculates how many years it will take for a $2,500 investment...
Create an Investment application that calculates how many years it will take for a $2,500 investment to be worth at least $5,000 if compounded annually at 7.5% ( Java Programming)
Create an application that calculates mph or (Miles Per Hour). There should be 2 textboxes for...
Create an application that calculates mph or (Miles Per Hour). There should be 2 textboxes for input, and 2 labels to label the input textboxes. The first textbox should be the miles driven. And the other textbox should be hours taken. There should be a button to calculate miles per hour. And a label or textbox for the results of the calculate. 1textbox for miles [input] 2textbox for hours (time used) [input] 3label for miles textbox 4label for hours textbox...
How to create a JS application using the code below that displays the lists of grades...
How to create a JS application using the code below that displays the lists of grades in their corresponding letter grade textbox and each grade being sorted from lowest to highest. <!DOCTYPE> <html> <head> <title>EXAM01_03</title> <style type="text/css"> form{color:black;background-color:lightgray;border:6px solid black;border-width:4px;width:450px;margin:1px;padding:1px;} #ans1,#ans2,#ans3,#ans4,#ans5,#numbers{background-color:white;border:4px solid black;} input[type="button"]{color:black;background-color:red;border:4px solid black;} input[type="text"]{margin:2px;} div.title{color:white;background-color:black;float: left; width: 450px; text-align:center;} </style> </head> <body>    <form>    <div class="title"><label>EXAM01_03</label></div>    <p style="clear:both;" />    <div style="float:left;width:150px;"><label>Enter Grade List:</label></div><div style="float:left;"><input type="text" id="numbers" /></div>    <p style="clear:both;" />    <div style="float:left;width:150px;"><label>A:</label></div><div...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT