Discount Get ITS 320 ALL WEEKS Solution ONLY $69.70 $92.93
ITS 320 Assignment 1 NEW - This simple exercise is meant to verif... [$8.99]
ITS 320 Assignment 2 NEW - Enter the code for the two classes &qu... [$10.99]
ITS 320 Assignment 3 NEW - Write a Java application that prompts ... [$11.99]
ITS 320 Assignment 4 NEW - Write a program to assign the integer ... [$14.99]
ITS 320 Assignment 5 NEW - Key in the PolyMain, Book, Almanac, an... [$14.99]
ITS 320 Assignment 6 NEW - Create three exception classes named N... [$14.99]
ITS 320 Assignment 7 NEW - Create a class called BankAccount. Th... [$15.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
ITS320 ITS 320 ITS/320 - Java program #7 - NEW VERSION - Create a class called BankAccount.  The BankAccount class should contain a String to store the customer name and a double to store the account balance
    ITS320 ITS 320 ITS/320 - Java program #7 - NEW VERSION - Create a class called BankAccount.  The BankAccount class should contain a String to store the customer name and a double to store the account balance

ITS320 ITS 320 ITS/320 - Java program #7 - NEW VERSION - Create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance

$15.99

Create a class called BankAccount.  The BankAccount class should contain a String to store the customer name and a double to store the account balance.  The BankAccount class should have 2 constructors as follows:

    public BankAccount(String name, double balance)
                       throws NegativeAmountException
    {
        // set name and balance
        // make sure balance is not negative
        // throw exception if balance is negative
    }

    public BankAccount(String name)
                       throws NegativeAmountException
    {
        // set name and use 0 balance
    }

As can be seen, the first constructor throws a NegativeAmountException if the balance being used to create the bank account is negative.  You will have to create this exception class yourself.

The BankAccount class should also contain methods to make a deposit, make a withdrawal, get the current balance, and print a bank account statement.  The interfaces for these methods should appear as follows:

    // update balance by adding deposit amount
// make sure deposit amount is not negative
// throw exception if deposit is negative
    public void deposit(double amount)
           throws NegativeAmountException

    // update balance by subtracting withdrawal amount
// throw exception if funds are not sufficient
// make sure withdrawal amount is not negative
// throw NegativeAmountException if amount is negative
// throw InsufficientFundsException if balance < amount
    public void withdraw(double amount)
       throws InsufficientFundsException, NegativeAmountException

    // return current balance
    public double getBalance()

    // print bank statement including customer name
// and current account balance
    public void printStatement();

Use the BankAccount class as the superclass for a SavingsAccount class.  In addition to the behaviors of a BankAccount, a SavingsAccount also accumulates interest,  therefore the SavingsAccount class contains a double that is populated with the current interest rate.  In addition to its constructors (you decide what the constructors should be), the SavingsAccount class should contain the following methods:

    // post monthly interest by multiplying current balance
// by current interest rate divided by 12 and then adding
// result to balance by making deposit
    public void postInterest()

    // print bank statement including customer name
// and current account balance (use printStatement from
// the BankAccount superclass)
// following this also print current interest rate
public void printStatement()

Once these two classes are completed, create a driver class called FinalExam containing a main method that tests the SavingsAccount class.  Within the driver test class, create a SavingsAccount object and then use it to make deposits, withdrawals, and to post the monthly interest. 

To make the program simpler, you can incorporate the initial data for the Savings Accounts directly in the program (e.g., no need to prompt for the account holder name or starting balance).  The only things you need to prompt for are the deposit amount and the withdrawal amount.  Also, to simplify the task, the only exceptions that you should handle are the NegativeAmountException and the InsufficientFundsException.  If either of these exception conditions occurs, print an appropriate error message and terminate the application.  You can simply re-throw any IOExceptions from the main.

Solution for ITS320 Program #7

Using java language

it is 100% correct solution !!!

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you

Attached Files

Move over [ preview ] file name to preview content in it!

  • Java program #7.zip [355.7KB]
    • Document.docx [252.9KB]
    • ITS320-Program-7-ScreenShot.jpg [97.4KB]
    • source code
      • BankAccount.java [1.6KB] [ preview ]
      • FinalExam.java [1.6KB] [ preview ]
      • InsufficientFundsException.java [0.3KB] [ preview ]
      • NegativeAmountException.java [0.3KB] [ preview ]
      • SavingsAccount.java [1.4KB] [ preview ]

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B