Create an arraylist to hold the bankaccounts

Assignment Help JAVA Programming
Reference no: EM132081399

Need to use java for this problem.

a.Modify the BankAccount program as follows:

Add a name to each BankAccount

Add an account number to your BankAccount. This should be similar to the process described on page 391. Remember to increase the lastAssignedNumber.

Add a method to get the account number.

Add a method to get the name associated in the account.

Add a method to add or change the name on the account. This should be a set method.

Create a method that adds an OverDraftFee which is a static public variable, page 392-393. The overdraft fee should be $20.

Change your withdraw method to check for an overdraft and if overdraft call the method in iv.

b. Modify the BankAccount tester as follows:

Create an ArrayList to hold the BankAccounts.

Create three bankAccounts by asking the user to input the name and balance for each holder.

Add the three BankAccounts to the ArrayList.

Using the first account, deposit $100.

From that same account, create a deposit that would cause the account to overdraft.

Print the name, account, and balance for all three accounts.

The BankAccount in question is below

public class BankAccount
{
private double balance;
private int accountNumber;
private static int lastAssignedNumber = 1000;

public BankAccount()
{
// initialise instance variables
balance = 0;
}
public BankAccount(double intialBalance)
{
balance = intialBalance;
}
public void deposit(double amount)
{
// put your code here
balance = balance + amount;
}
public void withdraw(double amount)
{
balance = balance - amount;

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

Reference no: EM132081399

Questions Cloud

Emotions and decision making : Emotions and decision making should all emotions and feeling be removed from decision making.
Need all of these to be in a dynamic linked library : You need all of these to be in a Dynamic Linked Library. All You need is the Classes for each and methods below.
What matters do transpire when corporations : What matters do transpire when corporations are considered the same as citizens by law?
What is and how are the interest of fair use doctrine : What Is and how are the interest of " fair use doctrine " are intended to protect... How does fiat use doctrine apply to the Bouchat case
Create an arraylist to hold the bankaccounts : Create three bankAccounts by asking the user to input the name and balance for each holder.Create an ArrayList to hold the BankAccounts.
Government contract dispute process : What are the formal steps in the government contract dispute process?
With respect to the federal supply schedules : With respect to the Federal Supply Schedules, discuss "fair and reasonable" pricing prior to any negotiations actually taking place
John interest in the business : How could John arrange to pay off Shark from his partnership profits? What could Shark do to try to seek repayment through John's interest in the business?
Severe abdominal pain and placed in an intensive care unit : Jasmine was hospitalized with severe abdominal pain and placed in an intensive care unit. Her doctor told the hospital personnel to order around-the-clock

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd