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

  Explain we have to make a project in java

We have to make a project in java . This is a small deskstop application no specifications given so far . The CD store has CD games and music we can rent a cd or we can buy . This is all we need to develop.

  Socket programming in java: tcp

In this project we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous service requests in parallel.

  Write java program which simulates flipping of coin

Write a Java program which simulates flipping of coin 1000 times and prints total number of heads and tails. You should create a class.

  Define a class called counter an object of this class is

define a class called counter. an object of this class is used to count things so it records a count that is a

  All your code should be in the main method

Write a Java test program, all your code should be in the main method, that asks the user for two numbers representing an investment value and interest rate

  You have to design and implement a simple and small email

helo i need your help in java assignment. i need solution asap. i have seen the same question on your website and even

  Implementing dijkstras shortest-path algorithm

Implementing Dijkstras shortest-path algorithm - To improve efficiency of the program, you should add some caching to it

  Program that allows two players to play tic-tac-toe

Implement a program that allows two players to play tic-tac-toe. Draw the game grid and an indication of whose turn it is (X or O). Upon the next click, check that the mouse click falls into an empty location,

  Write a program cmsc401 java

Write a program cmsc401.java that receives a sequence of commands (from 1 up to 10000 commands)

  Write a program to read and add polynomials

Write a program to read and add polynomials - If the exponents are equal, then create a new term with that exponent and the sum of the coefficients, and advance both iterators.

  Implement an iterative method with a for loop

Different scientists have developed Predator-Prey models to try to understand the interactions and foresee the evolution of the populations.

  Solving programming problems

Write a computer program that will figure out the total of an order when given the amount of the order ($1000) and a sales tax rate of eight percent.

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