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

What are some advantagesdisadvantages to children who are

What are some advantages/disadvantages to children who are either exposed and not exposed to multiple languages. Are the children exposed to multiple languages more intelligent?

Jackson functional behavior assessmentchildwith problem

Jackson Functional Behavior Assessment Childwith Problem Behavior(s): Jackson                       Date of Interview: 9/25    Age: 4 Yrs*Mos                                                                Sex:    M *  F ...

Transition to professional practice 2 pep assignment -

Transition to professional practice 2 (PEP) Assignment - Clinical Case Conference Report Assessment Description: This academic paper requires students to write up the patient presented at their Clinical Case Conference ( ...

Question write 400-600 wordsas the human resources training

Question: Write 400-600 words As the human resources training professional, you have been asked to train hiring managers about the importance of knowledge of employment laws in creating a fair and safe work environment. ...

One definition of diversion is the halting or suspension

One definition of diversion is "the halting or suspension before conviction of formal criminal proceedings against a person, conditioned on some form of counter performance by the defendant" (George, 1984). There are sev ...

Question identify how faith in reincarnation appears in

Question: Identify how faith in reincarnation appears in three different works, each from a different Humanities discipline (visual art, music, dance, poetry, prose, theater, film, religion). For instance, you could choo ...

Assignment health promotion and wellnesscultural

Assignment: Health Promotion and Wellness. Cultural Diversity. Environmental Health. Read chapter 4, 13 & 14 of the class textbook and review the attached PowerPoint presentations. Once done, answer the following questio ...

Write a reflection paper that is a minimum of three pages

Write a reflection paper that is a minimum of three pages. Reflect on the best, most rewarding experience that you have ever had as part of a team. Maybe this experience was in your work organization, a military unit, at ...

Question the development of diseases or the state of

Question: The development of diseases or the state of wellness and health are influenced by social, economic, environmental, and demographic factors of a population. As such, population statistics play a major role in de ...

Discussion the media and public trust please respond to

Discussion : "The Media and Public Trust" Please respond to the following: • Discuss one or two reasons it seems that the media have lost the public trust in the U.S. • Debate It - Take a position on this statement: Demo ...

  • 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