subject
Computers and Technology, 05.07.2021 19:50 eggg65

In the file BankAccount. java, build a class called BankAccount that manages checking and savings accounts. The class has three private member fields: a customer name (String), the customer's savings account balance (double), and the customer's checking account balance (double). Implement the following Constructor and instance methods as listed below:
public BankAccount(String newName, double amt1, double amt2) - set the customer name to parameter newName, set the checking account balance to parameter amt1 and set the savings account balance to parameter amt2. (amt stands for amount)
public void setName(String newName) - set the customer name
public String getName() - return the customer name
public void setChecking(double amt) - set the checking account balance to parameter amt
public double getChecking() - return the checking account balance
public void setSavings(double amt) - set the savings account balance to parameter amt
public double getSavings() - return the savings account balance
public void depositChecking(double amt) - add parameter amt to the checking account balance (only if positive)
public void depositSavings(double amt) - add parameter amt to the savings account balance (only if positive)
public void withdrawChecking(double amt) - subtract parameter amt from the checking account balance (only if positive)
public void withdrawSavings(double amt) - subtract parameter amt from the savings account balance (only if positive)
public void transferToSavings(double amt) - subtract parameter amt from the checking account balance and add to the savings account balance (only if positive)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:10, 17795
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
image
Computers and Technology, 23.06.2019 03:00, tay9122
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
image
Computers and Technology, 23.06.2019 14:30, HarryPotter10
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
image
Computers and Technology, 23.06.2019 15:00, herchellann302
To check whether your writing is clear , you can
Answers: 2
You know the right answer?
In the file BankAccount. java, build a class called BankAccount that manages checking and savings ac...

Questions in other subjects: