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

  Imagine that you have been assigned

Imagine that you have been assigned to implement a sorting program. The goal is to make this program general purpose, in that you don't want to define in advance what record or key types are used

  Days alive calculator

The context for this assignment (all parts) is a ‘Days Alive Calculator' - a small desktop application for calculating the number of days someone has been alive based on the date of birth and a second date, which may be today's date or some other ..

  Write a recursive method to reverse a string.

write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem?

  What is the purpose of the restrict keyword in c99

Arrays of strings in C and C++ can also be initialized with string literals. In this case, the array is one of pointers to characters.

  Create an array that stores in integers from the keyboard

create an array that stores in integers from the keyboard and then I can scan that array to check numbers in order, if the number I check is greater than the previous then I will set the next number in the array to the higher value.

  Write java program prints strings given at command line

Write down the program Average.java which just prints strings which it is given at command line, one per line. If nothing is given at command line, print "No arguments".

  Determine the purpose of using javascriptreg on a website

what is the purpose of using javascriptreg on a website? what is a specific example of a javascriptreg application that

  Qr codes are a popular way

QR codes are a popular way to encode data for easy reading by computerized cameras. True QR codes contain error correction, format specifiers, version information, and a size variable layout that makes them harder to decode and process

  Create a class safestack that implements a stack of strings

Create a class SafeStack that implements a stack of strings

  System schedule on a multiprocessor-multicore environment

This program assignment is provided to let the students understand how to the Operating Systems schedule all the processes on a multiprocessor or multicore environment.

  Write a statement that writes both of their values

Given an interger variable i and floating-point variable f, write a statement that writes both of their values to standard output in the following format: i=value-of-i f=value-of-f.

  What things are you struggling to understand

Discuss your experiences with the programming assignment - what things are you struggling to understand?

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