Explain why the teller application can call the withdraw

Assignment Help JAVA Programming
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.

Reference no: EM13809320

Questions Cloud

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.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java threads

This is an introductory assignment on Java synchronization. You will use Java Threads while learning more about concurrency and achieving atomicity using Java’s inbuilt mechanisms.

  Pronouns, and prepositions

Type addKeyword(): for each word on each page, add to a (keyword, URLs) list or dictionary, excluding articles, pronouns, and prepositions. For example:

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Recommend at least five factors which programmers must

propose at least five factors that programmers should consider when choosing between data types such as those used in c

  Write a program that converts number from binary to decimal

write a program that Converts a Number from Binary to Decimal  by using reading keyboard input.

  1 what makes a program easy to modify2 describe the order

1. what makes a program easy to modify?2. describe the order of magnitude of the following code section using bigo

  Define java implementation to implement the requirements

Produce a Java implementation to implement the requirements of Question 1, that is, to perform the 32-bits two complement and 32-bit floating-point conversion of a given number.

  Generate a gui to perform as a binary calculator

Generate a GUI to perform as a binary calculator which can do addition, subtraction, multiplication, division, logical bit AND, and logical bit OR for binary integer numbers

  Designing an inheritance between classes

Why is an "is-a" relationship important when designing an inheritance between classes

  Part-2write a program that will perform some of the basic

part-2write a program that will perform some of the basic tasks accomplished by a file integrity checker such as

  Create a method that would search through an arraylist

What is the best way of the following ways (For each, Iterator, While with index) that you would use to create a method that would search through an ArrayList of files for a certain file and then delete it, and why?

  What is printed out by the following code

What is printed out by the following code

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