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

  Write an inner class called randomcolorlistener

Write an inner class called RandomColorListener to implement theActionListener interface and to listen to the JButton in the SOUTH region.

  Create an account object and make sure it has values

Create an Account object and make sure it has values for all its instance variables. Similarly, you can use hard-code parameter values.

  Create an application using html5

Create an application using HTML5, CSS, and JavaScript that has an image or figure of a trashcan

  Write an app to test class integerset

Create class IntegerSet. Each IntegerSet object can hold integers in the range 0-100. The set is represented by an array of bools. Array element

  Write program that will store the lakers roster in an array

Write a program that will store the Lakers (or your favorite basketball team) roster in an array. You will then loop through the array to display each player and their information.

  Whats the difference between adapter and lisener

What's the difference between Adapter and Lisener -What is the property of an adapter

  What aspects of judaism are rejected or reinterpreted

What theology does Jesus present in the two excerpts from the Gospels that are a part of the readings? What aspects of Judaism are strongly represented? What aspects of Judaism are rejected or reinterpreted?

  Write the bubble sort

The village of Marengo conducted a census and collected records that have household data, including the number of occupants in each household.

  Case study - greenhouse humidity control

The control system that will respond to sensor information to turn on/off a misting device, turn on/off a watering system and open/close ventilation windows.

  How does a marketer balance the short-term gains

How does a marketer balance the short-term gains that sales promotion can deliver against the possible negative long-term consequences such promotions might have for brands? Use appropriate examples.

  Corrections as necessary and output screen snapshots

Submit all completed programs, with corrections as necessary and output screen snapshots, to demonstrate that they all perform properly to meet the specifications.

  Calculation or a calendar of some activity.

1. Provide Java code for a simple class of your choice. Be sure to include at least one constructor, two methods and two fields. The fields should be private.Create a test class to construct and call the methods of your class. Describe your class and..

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