Write the java code for an abstract class named account

Assignment Help JAVA Programming
Reference no: EM13781269

Write the Java code for an abstract class named Account which has two data members; one for the account number and the other for the account balance (use information hiding). The Account class should include get and set methods for both data members and a constructor that initializes the two data members from the values received in the parameter list. Create (override) the toString() method that returns a string indicating the account number and the account balance. In addition to these methods, the Account class will have one abstract method called calculateInterest. The calculateInterest method will take one argument representing the interest rate and will return an amount representing the interest calculated based on the balance.

In addition to the Account superclass, write the code for two subclasses: CheckingAcct and SavingsAcct. The CheckingAcct interest is calculated only if the account balance is over 700 dollars. The checking account should also be able to tell the user if cosignatories are required or not with the default being not required. The SavingAcct interest is calculated on any balance greater than zero. The SavingsAcct constructor should initialize its only data member called accumulatedInterest to zero. Assume the interest calculation is for the year and the rate is 7%.

Write the code for a class named TestAccounts that will create an array of 3 Account references, instantiates two CheckingAcct objects and one SavingsAcct object, and then assigns the CheckingAcct objects to the first two array elements to the array mentioned above, and the SavingsAcct object to the third. Create a loop that calls the calculateInterest method and then displays the interest for all three accounts using the array references.

Reference no: EM13781269

Questions Cloud

Wriyte an essay about the multiple meaning of family : Wriyte an essay about the multiple meaning of family.
Effect of fear-aggression-nervous system : Explain the role of the nervous system. Describe the effect of fear, aggression, or anxiety on the specified behavior.
Briefly define consideration and explain why it is important : Briefly define consideration and explain why it is important. Briefly identify and describe 2 advantages and 2 disadvantages of public corporations versus private closely held corporations
Write a paper about as chinas kite makers age : Write a paper about As China's kite makers age, lofty tradition goes to ground By Stuart Leavenworth, McClatchy Foreign Staff.
Write the java code for an abstract class named account : Write the Java code for an abstract class named Account which has two data members; one for the account number and the other for the account balance (use information hiding). The Account class should include get and set methods for both data membe..
Wayne winston on analytics : Write a 1- to 2-page proposal to your current or previous company discussing how analytics can be used in your company to improve sales through your retail outlets or customer service department. If you do not work in a retail company, then pick o..
Telephone crisis intervention hotline : In this discussion, you are the director of a 24 hour telephone crisis intervention hotline. Your staff of volunteers has been through a rigorous training in which you employed the concept of "overtraining" and required them to role play interveni..
Describe each organism and its environmental needs : Make a list identifying at least ten organisms-at least five plants and five animals-that live in your biome, and describe how these organisms interact with one another. For example, is the relationship competitive or symbiotic?
Describe the different perspectives on personality : Describe the different perspectives on personality - Explain how changeable or unchangeable you think personality is.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Console application for a small car servicing company

Develop a program for the service department staff - Console application for a small car servicing company

  Design and implement an application to manage a tournament

Design and implement an application to manage a tennis tournament of 16 players - design and implement an application to manage a tournament. Is there anybody who knows how to do this?

  Prompt the user for an int between an upper and lower

prompt the user for an int between an upper and lower boundary. reuse the validateinput method from project to validate

  Java class to accept a user-s hourly rate of pay

Write a class that accepts a user's hourly rate of pay and the number of hours worked. Display the user's gross pay, the withholding tax (15% of gross pay), and the net pay (gross pay - withholding).

  How to detect the correct ip address and run it locally

When you compile the two modules, with disabling the package statement, it runs on one single machine, that's running the server

  Evaluate an infix expression entered by the user

Spaces between tokens are allowed but not required. The program will repeatedly prompt the user for the value of x, displaying the value of the expression each time. When the user enters the letter q instead of a number, the program terminates.

  Each instance of this class will represent one book a book

each instance of this class will represent one book. a book consists of the title of the book a string and the authors.

  Difference for class linked bag and test into main program

write a method difference for the class linked bag and test into main program.

  Recursive method

What will happen when the following recursive method is executed with an initial input value of 10?public int recursiveMethod(int input)

  Graphics program that draws 12 strings

Write a graphics program that draws 12 strings, one each for the 12 standard colors, besides Color.WHITE, each in its own color. Provide a class ColorNameViewer and a class ColorNameComponent.

  A method that takes a two-dimensional array

A method that takes a two-dimensional array of int's as a parameter and searches the array for the second parameter, returning true if the second parameter matches any of the integers in the array, and false otherwise.

  What is a generic subprogram in java

How do you describe as a type in C++ a pointer to a function that takes two ints as arguments and returns a double. What is a generic subprogram in Java. What are its advantages

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