Reference no: EM13809320
For this Programming activity, you will create the SavingAccount class, which inherits directly from the BankAccount class. The SavingsAccountclass inherits from the version ofthe BankAccountclass in which the balanceis declared to be private.The SavingsAccountsubclass adds an annual interestRateinstance variable,as well as supporting methods to access,change,and apply the interest rate to the account balance.
Instructions
Copy the source files in the Programming Activity 1 directory for this chap- When you have completed the six tasks,load,compile,and run the Teller application (Teller.java),which you will use to test your SavingsAccount class.When the Teller application begins,you will be prompted with a dialog box for a starting balance.Ifyou press "Enter"or the "OK"button without entering a balance, the Teller application will use the default constructor to instantiate a SavingsAccountobject.Ifyou enter a starting balance,the Teller application will prompt you for an interest rate and will instantiate a SavingsAccountobject using the overloaded constructor.Once the SavingsAccountobject has been instantiated,the Teller application will open the window shown in Figure10.10,which provides buttons you can use to call the SavingsAccountmethods to test your code. Below the buttons is a ledger that displays the current state ofthe savings account.As you click on the various buttons,the ledger will display the operation performed and the values ofthe balance and the interest rate when that operation is complete. The operations performed by each button are already coded for you and are the following:
IChange Interest Rate-prompts for a new interest rate and calls your set Interest Rate method
IApply Interest-calls your apply Interest method I Deposit-prompts for the deposit amount and calls the deposit method inherited from BankAccount I Withdraw-prompts for the withdrawal amount and calls the withdraw method inherited from BankAccount answer the following questions.
1. Explain why the Teller application can call the withdraw and deposit methods using a SavingsAccount object reference, even though we did not define these methods.
2. Explain why your applyInterest method in the SavingAccount class needs to call the deposit method of the BankAccount class.
Write a gui-based program that analyzes a round of golf
: Write a GUI-based program that analyzes a round of golf. You will retrieve the data for 18 holes from a text file. On each line in the file will be the par for that hole (3, 4, or 5) and your core for that hole should be displayed in a label
|
Write a critical essay about movie the man who was not there
: Write a critical essay about the movie The Man Who Wasn't There and Tay Garnett's 1946 film noir classic The Postman Always Rings Twice.
|
Explanation of how assumptions of the test were met or not
: Explanation of how assumptions of the test were met or not met
|
What is the best way to write a case study on one business i
: What is the best way to write a case study on one business in the corporate scandals of 1980s and 1990s?
|
Explain why the teller application can call the withdraw
: Explain why the Teller application can call the withdraw and deposit methods using a SavingsAccount object reference, even though we did not define these methods
|
Explain and discuss if the system failed to protect kristin
: Was this the best way to go to protect Kristin. Do you suggest any other ways to go about it. What are your suggestions and why. Explain and discuss if the system failed to protect Kristin and if so why.
|
Explains the steps you will take in developing the new syste
: Essay on the following: You have just graduated from Herzing University. As a result of having such wonderful credentials, you have subsequently landed a great new job in a large organization. Your new position is "Director of Knowledge Management". ..
|
Write a method insert at that takes an array of integers
: Write a method, insertAt, that takes four parameters: an array of integers; the length of the array; an integer, say, insertItem; and an integer, say, index
|
Write a paper about animals do have rights
: Write a paper about Animals do have rights.
|