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
In theory, a(n) _____ can be an independent centralized database management system with proper interfaces to support remote acce
Vlad [161]

Answer:

Transaction Manger

Explanation:

Transaction Manger

Transaction Manager is responsible for transaction between resources that are available. It works as interface to support remote access form other systems in Data base management system.

8 0
2 years ago
Which are the best examples of costs that should be considered when creating a project budget?
Vlada [557]

Answer:

I would say material costs and hiring costs, idk if that helps or not

4 0
3 years ago
Which is true of ASCII and Unicode?
allochka39001 [22]

Answer:

The correct options is;

Every character written in A S C I I can be represented using Unicode

Explanation:

All characters found in A S C I I can be found in Unicode such that A S C I I is a subset of Unicode whereby the meaning of the numbers from 0 to 127 are the same in both A S C I I and Unicode

The size of the A S C I I character in 8-bit A S C I I encoding is 8 bits while a Unicode U T F - 8 encoding has between 8 bits (1 byte) and 32 bits (4-bytes)

A S C I I assigns only 127 of the 255 possible numbers that can be stored in an 8-bits character, where the spare characters are then used by P C s for accented characters, therefore, it A S C I I does not define accented characters

4 0
2 years ago
Acrynom for wys or wyg
REY [17]
What you said? And what you get?
8 0
2 years ago
Briefly explain specialisation?​
Jlenok [28]

Answer:

b

Explanation:

4 0
2 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog? A. web page B. website C. web address D. email
    7·2 answers
  • In an airline reservation system, on entering the flight number, the flight schedule and the flight status are displayed. In thi
    13·2 answers
  • Briefly describe the client/server model.
    8·1 answer
  • Mary is entering her senior year of college. She has a meeting on Friday with her advisor to discuss her career plans.Mary is al
    15·1 answer
  • What is the smallest unit of data on the hard drive?
    5·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • Which process centers the spreadsheet's content on the page?
    15·1 answer
  • Which tool can be used to increase the space between a bullet point or a number and text?
    11·2 answers
  • Define technical writing. The proposal introduces the ……. (5 Mark)
    9·1 answer
  • Please help me i’ll give you brainlist
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!