Write a constructor that takes a name

Assignment Help Other Subject
Reference no: EM132150407

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.

Reference no: EM132150407

Questions Cloud

National collegiate athletic association data : According to the same National Collegiate Athletic Association data, the means and standard deviations of eligibility and retention rates
Relationship between the number of hours of study : Some Statistics students were interested in finding out in there was a relationship between the number of hours of study for a chapter and the score
Implement simple linear regression : In order to implement simple linear regression, it requires that we calculate statistical properties from the data such as mean, variance and covariance.
Graph the probability distribution function : a. Graph the probability distribution function. b. Calculate and graph the cumulative probability distribution.
Write a constructor that takes a name : Write a constructor that takes a name and an initial balance as parameters and calls the constructor for the superclass.
Collinearity and correlation between variables : Is it possible to have no (or very small) collinearity and correlation between variables, yet have the same R squared and Adjusted R squared values?
Compute the mean times of success for both experiments : Compute the mean times of success for both experiments. Can you explain why these are different?
What is the expected number of households : (a) What is the expected number of households who are seeking price information?
Independent variable and a continuous dependent variable : Can you look for multicollinearity between a categorical independent variable and a continuous dependent variable or can you only look for multicollinearity

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd