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
Janice has decided that the best approach to programming a new social media app is to start with a small portion of it by writin
Maru [420]

Answer:

blacc

bhhj

Explanation:

4 0
2 years ago
What is an effective technique for searching the web? Choose one.
kakasveta [241]
Option B is what i would say 

if you are searching something and want a specific answer you are going to need to be specific on how you search it
4 0
3 years ago
Read 2 more answers
Would an artificial intelligence come into existence anytime in the next 30 years?
Scrat [10]
Artificial Intelligence, based on neural networks, is available now.
4 0
3 years ago
Teaching Siri or the Google Assistant how to recognize your voice by reading to it is an example of ________.
nata0808 [166]

Answer:

4. Supervised learning.

Explanation:

Supervised and Unsupervised learning are both learning approaches in machine learning. In other words, they are sub-branches in machine learning.

In supervised learning, an algorithm(a function) is used to map input(s) to output(s). The aim of supervised learning is to predict output variables for given input data using a mapping function. When an input is given, predictions can be made to get the output.

Unsupervised learning on the other hand is suitable when no output variables are needed. The only data needed are the inputs. In this type of learning, the system just keeps learning more about the inputs.

Special applications of supervised learning are in image recognition, speech recognition, financial analysis, neural networking, forecasting and a whole lot more.

Application of unsupervised learning is in pre-processing of data during exploratory analysis.

<em>Hope this helps!</em>

8 0
3 years ago
The internet has provided great opportunities for fundraising. true/false
alekssr [168]
True, sites such as kickstarter and just giving are fantastic examples of such.
8 0
3 years ago
Other questions:
  • Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
    11·1 answer
  • Suppose the m2 money supply is $13 trillion, including: $7 trillion in savings accounts $3 trillion in checking accounts $1 tril
    9·1 answer
  • Which network is the predecessor of the Internet?
    13·1 answer
  • How many possible keys does the playfair cipher have? an approximate power of 2
    14·1 answer
  • Program 7 - Circle You write ALL the code, then run it - Produce the correct output. Turn in code and screen print of successful
    15·1 answer
  • Who is a second-degree contact on a professional networking profile?
    12·1 answer
  • Which function of NOS involves swapping programs and files
    6·1 answer
  • What do application in productivity suites have in common
    5·1 answer
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
  • A company is looking for an employee to design and test connections in its
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!