1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zhannawk [14.2K]
3 years ago
8

"The goal of this assignment is to give you some experience building a program that uses objects. You will use the BankAccount c

lass you created in Lab 3 to create a banking program. The program must display a menu to the user to allow the user to select a transaction like deposit, withdraw, transfer, create a bank account, and quit the program. The program should allow a user to perform multiple transactions until they quit the program by selecting the quit option. The program must perform all operations on the BankAccount objects your program will store. The operations must search through the collection of BankAccount objects and find the correct object to perform the operation on. When a user creates an account, your program should create a new BankAccount object with the user's input values and store it in an Array or ArrayList."
Computers and Technology
1 answer:
MArishka [77]3 years ago
3 0

Answer:

see explaination

Explanation:

Please find my detailed implementation.

I have tested with Single Bank account object.

You can create array list of Bank Account in test program:

public class BankAccount {

private String name;

private int accountNumber;

private int PIN;

private double balance;

public BankAccount(int accN, int pin) {

accountNumber = accN;

PIN = pin;

}

public BankAccount () {

name = "Undefined";

accountNumber = 0;

PIN = 0;

balance = 0;

}

public String getName() {

return name;

}

public int getAccountNumber() {

return accountNumber;

}

public int getPIN() {

return PIN;

}

public double getBalance() {

return balance;

}

public void setName(String name) {

this.name = name;

}

public void setAccountNumber(int accountNumber) {

this.accountNumber = accountNumber;

}

public void setPIN(int pIN) {

PIN = pIN;

}

public void setBalance(double balance) {

this.balance = balance;

}

public void withdrawal(double amount) {

if(amount <= balance) {

balance = balance - amount;

}

}

public void deposit(double amount) {

balance += amount;

}

public void transferFunds (double amount, BankAccount toBankAccount) {

if(amount >= balance) {

toBankAccount.setBalance(amount + toBankAccount.getBalance());

balance -= amount;

}

}

atOverride //change the at with the at symbol

public String toString() {

return "{id:"+accountNumber+", name:"+name+", pin:"+PIN+", balance:$"+balance+"}";

}

}

#########

public class BankAccountTest {

public static void main(String[] args) {

BankAccount myAccount = new BankAccount(526323450, 1234);

myAccount.setName("Pravesh");

myAccount.setBalance(345.64);

System.out.println(myAccount);

BankAccount anotherAccount = new BankAccount(); //default constructor

System.out.println(anotherAccount);

}

}

You might be interested in
You are creating a presentation and you have come to the last slide. You still have more information to add. What should you do?
sdas [7]

Answer:

Click on the New Slide icon.

Explanation:

You need to create a new slide to add more information to your presentation, you cannot just squeeze all bits of remaining info onto previous slides.  First, the information might not be related, second it will overload the slides, not good for presentations.

The "New Slide" option wouldn't be in the "Format" menu, since that menu is for the formatting of the text and slides, not to add a new one.

6 0
3 years ago
When troubleshooting a network issue where a single host is unable to connect to the network, what is the first thing you should
prisoha [69]

The first thing you should do is Check whether the network cable is properly connected.

<h3>What is basic network troubleshooting?</h3>

Network troubleshooting is the integrated measures and processes used to identify, analyze and solve problems within a computer network. It's a logical approach that network engineers use to resolve network issues and improve network function.

<h3>What are network troubleshooting tools?</h3>

In simple terms, network troubleshooting tools are standalone or integrated resolutions that help network administrators identify the root reason of a network issue in order to fix it.

To learn more about  Network troubleshooting, refer

brainly.com/question/28179799

#SPJ4

6 0
1 year ago
Many of the first photographers were actullay scientists and inventors
scoray [572]

Answer:

True, if its a true or false. Otherwise I am of no help.

Explanation:

5 0
3 years ago
What is the definition of a nested function?
stepladder [879]

Answer:

d

Explanation:

3 0
3 years ago
Intelligence is to creativity as _____ is to _____. Group of answer choices spatial intelligence; musical intelligence correct t
NARA [144]

Answer:

convergent thinking is to divergent thinking.

Explanation:

5 0
3 years ago
Other questions:
  • In the year of our Lord 66, the Emperor Nero, being at that time in the twenty-ninth year of his life and the thirteenth of his
    10·1 answer
  • Which computer device is used to capture or copy a photograph to place in a report?
    14·1 answer
  • ____ is the process of drawing a series of increasingly detailed DFDs, until all functional primitives are identified.
    7·1 answer
  • Microsoft windows malicious software removal tool fake or real
    8·1 answer
  • Security Definition updates for windows defender are performed through the ——— function in windows server 2016
    7·2 answers
  • Examples of analog computer
    8·1 answer
  • A computer is assigned an IP address of 169.254.33.16. What can be said about the computer, based on the assigned address?
    9·1 answer
  • Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
    12·1 answer
  • Document accurately describes the differences between servers and computers and between local and wide area networks. Document p
    5·1 answer
  • Imagine that you are about to make a presentation during an online meeting, where people will need to be able to see you, and yo
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!