Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

Task #1 Extending the BankAccount Class

1. Copy the files AccountDriver.java and BankAccount.java from Blackboard. BankAccount.java is complete and will not need to be modified.

2. Create a new class called SavingsAccount that extends BankAccount.

3. It should contain an instance variable called rate that represents the annual interest rate. Set it equal to 2.5%.

4. It should also have an instance variable called savingsNumber, initialized to 0. In this bank, you have one account number, but can have several savings accounts with that same number. Each individual savings account is identified by the number following a dash. For example, 100001-0 is the first savings account you open, 100001-1 would be another savings account that is still part of your same account. This is so that you can keep some funds separate from the others, like a Christmas club account.

5. An instance variable called accountNumber, that will hide the accountNumber from the superclass, should also be in this class.

6. Write a constructor that takes a name and an initial balance as parameters and calls the constructor for the superclass. It should initialize accountNumber to be the current value in the superclass accountNumber (the hidden instance variable) concatenated with a hyphen and then the savingsNumber.

7. Write a method called postInterest that has no parameters and returns no value. This method will calculate one month's worth of interest on the balance and deposit it into the account.

8. Write a method that overrides the getAccountNumber method in thesuperclass.

9. Write a copy constructor that creates another savings account for the same person.

It should take the original savings account and an initial balance as parameters. It should call the copy constructor of the superclass, and assign the savingsNumber to be one more than the savingsNumber of the original savings account. It should assign the accountNumber to be the accountNumber of the superclass concatenated with the hyphen and the savingsNumber of the new account.

10. Compile and debug this class.

11. Use the AccountDriver class to test out your classes. If you named and created your classes and methods correctly, it should not have any difficulties. If you have errors, do not edit the AccountDriver class. You must make your classes work with this program.

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M93137870

Have any Question? 


Related Questions in Homework Help/Study Tips

Do the following1 taking responsibility for the action you

Do the following: 1. Taking responsibility for the action you put forth and the consequences of that action (victim versus creator, emotional intelligence, and time management) 2. Having an awareness of your strengths, v ...

Question in a nightmare come true you walk in to class one

Question: In a nightmare come true, you walk in to class one day to see there is a midterm you entirely forgot about. (I actually did this in my undergrad, I don't recommend it.) The exam contains exactly one multiple-ch ...

Question based on the article from the weekly required

Question: Based on the article from the weekly required readings entitled, "Workplace communication problems: Inquiries by employees and applicable solutions," with a specific focus on the section Communication Skills Ed ...

Question servant leaders must be internally consistent with

Question: Servant leaders must be internally consistent with their words and actions. Describe a mentor that you have had that displayed this kind of credibility. Share an example of what you witnessed from this person. ...

There areone short videos and answer some simple questions

There areone short videos, and answer some simple questions. Do not need to write too much details for each questions, just use simple and easy words as you can. FSF #38: John Williams - The Raiders march (Raiders of the ...

Question define and discuss work-life balance develop a

Question: Define and discuss work-life balance. Develop a profile of the type of person most likely to experience extensive work-family conflict. Identify work pressures, family pressures, and personal characteristics mo ...

Question write an 1500 words essay about the chosen plant

Question: Write an 1500 words essay about the chosen plant (Basil) following the prompt below: Scientific and Medical Evidence( Chosen plant; Basil) Herbs and plants contain chemical compounds; some of them are effective ...

Question cognition and attention in performancedecision

Question: Cognition and Attention in Performance Decision making and cognitive processes are influenced by attention, memory, and the task. The cognitive and attentional processes can be described at neurological and/or ...

Question 1 what do you know about blockchain2 how do you

Question: 1. What do you know about Blockchain? 2. How do you protect your Bitcoin bank account from adding a duplicate transaction(s) i.e a $5,200.00 debit? The response must be typed, single spaced, must be in times ne ...

Question instructions imagine that you are the human

Question: Instructions: Imagine that you are the human resources (HR) manager at a small start-up company, and your company has just been awarded a new contract that is requiring a huge increase in the organization's wor ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As