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
9. What is the difference between a hand-drawn sketch, a working drawing, and a 3D model?
jarptica [38.1K]
A hand draw sketch is drawing with just a pencil and paper. Also, a working drawing is a drawing on at a job. The 3D sketch is on the computer.

3 0
3 years ago
What is the difference between First Person Shooters and Construction Simulations?
Marianna [84]

Answer:No clue

Explanation:

5 0
3 years ago
Read 2 more answers
Write a script that will read the file, (strip the carriage returns), create a dictionary of names and favorite radishes and cre
amm1812

Answer:

python code below:

names={}#first dictionary for names and favorite

favor={}#radish type and how many are favorite

f=open("raddish.txt")#opening file

for i in f:#for each line

j=i.strip().split("-")#splitting base on -

names[j[0].strip()]=j[1].strip()#getting first dictionary

if j[1].lower().strip() in favor:#counting the favorite elements

favor[j[1].lower().strip()]+=1

else:

favor[j[1].lower().strip()]=1

print ("First Dictionary",names)#printing the names

print("second dictionary:",favor)#printing the favorite numbers

f.close()#closing file

Explanation:

The program was implemented using python programming language.

Its operation is to read the file, (strip the carriage returns), create a dictionary of names and favorite radishes and create a dictionary of each radish type and the number of people who chose that as their favorite.

It returns as output the names of people entered for the Radishes.

See attachment for screenshot.

8 0
3 years ago
In addition to avoidance and adaptation, two other means of risk reduction available to managers are ________ and ________. A. q
MrRissso [65]

Answer:

(b). dependency and hedging.

Explanation:

In the management of risk, four common approaches for reducing risk are;

i. <em>Avoidance</em>: Especially if a risk involved in the management of a resource (or project) poses or presents a negative consequence, the best way to manage the risk simply avoid it by making sure it doesn't happen. This can be by cancelling a project or restructuring it.

ii. <em>Adaptation</em>: Another way of managing the risk associated with a resource (human or non-human resource) is to control the risk either by increasing resilience or reducing vulnerability. This is called adaptation.

iii. <em>Dependency: </em>This means accepting the risk since every project or business has inherently in it some risk associated. Dealing with it might be a way out especially knowing that there might be some experience to be gained in order to tackle similar situation in the future.

iv. <em>Hedging: </em>This means transferring the risk to some other business or organization. An example might be to get an insurance to manage this risk. In this case, the risk is transferred to the insurance company.

7 0
2 years ago
Read 2 more answers
This information is stored in every IP packet to make sure that the packet is eventually discarded if it cannot find the address
Andreas93 [3]

Answer:

TTL

Explanation:

TTL means time -to- live field is a counter that is designed to keep packets from circulating indefinitely in the network case forwarding tables accidentally create cycles. An IP datagram is typically initialized with a TTL of 60 or 64 and the TTL is decremented by one each time it enters a router. If the TTL reaches zero, the router will discard the packet. It is one of the components of the IP datagram

6 0
3 years ago
Other questions:
  • Knowing the meaning of the acronym WYSIWYG can be most helpful to you when you
    14·1 answer
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    12·1 answer
  • PLEASE HELP ME ON THIS..............PLEASEEEEEEEEEEEE PLEASEEEEEE<br><br> ITTS EASYYYYYYYY
    12·1 answer
  • When creating a shape in Word, what are some available options? Check all that apply. adding text to the shape changing the size
    6·1 answer
  • Anyone know this awnser computer science
    14·2 answers
  • It is a minor cereal of importance only in West Africa where it is eaten in place of rice during during famines. Used for salads
    10·1 answer
  • What do you get with brainly points
    9·1 answer
  • Which of the following images illustrates safe driving?
    8·2 answers
  • Write a q basic program to find the sum of all the even numbers from 1 to 50​
    14·1 answer
  • The objective fuction of linear progrmming should be
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!