Design an abstract class named bankaccount

Assignment Help JAVA Programming
Reference no: EM131374050

Java - BankAccount and SavingsAccount-

Design an abstract class named BankAccount to hold the following data for a bank account: -Balance -Number of deposits this month -Number of withdrawals -Annual interest rate -Monthly service charges The class should have the following methods: Constructor: The constructor should accept arguments for the balance and annual interest rate.

Deposit: A method that accepts an argument for the amount of the deposit. The method should add the argument to the account balance. It should also increment the variable holding the number of deposits. Withdraw: A method that accepts an argument for the amount of the withdrawal. The method should subtract the argument from the balance. It should also increment the variable holding the number of withdrawals.

calcInterest: A method that updates the balance by calculating the monthly interest earned by the account, and adding this interest to the balance.

This is performed by the following formulas: Monthly Interest Rate = (Annual Interest Rate / 12) Monthly Interest = Balance * Monthly Interest Rate Balance = Balance + Monthly Interest

monthlyProcess: A method that subtracts the monthly service charges from the bal- ance, calls the calcInterest method, and then sets the variables that hold the number of withdrawals, number of deposits, and monthly service charges to zero.

Next, design a SavingsAccount class that extends the BankAccount class. The SavingsAccount class should have a status field to represent an active or inactive account. If the balance of a savings account falls below $25, it becomes inactive. (The status field could be a boolean variable.) No more withdrawals can be made until the balance is raised above $25, at which time the account becomes active again. The savings account class should have the following methods:

withdraw: A method that determines whether the account is inactive before a withdrawal is made. (No withdrawal will be allowed if the account is not active.) A withdrawal is then made by calling the superclass version of the method.

deposit: A method that determines whether the account is inactive before a deposit is made. If the account is inactive and the deposit brings the balance above $25, the account becomes active again. The deposit is then made by calling the superclass version of the method.

monthlyProcess: Before the superclass method is called, this method checks the number of withdrawals. If the number of withdrawals for the month is more than 4, a service charge of $1 for each withdrawal above 4 is added to the superclass field that holds the monthly service charges. (Don't forget to check the account balance after the service charge is taken. If the balance falls below $25, the account becomes inactive.)

Reference no: EM131374050

Questions Cloud

Determine the nutritional information : Where can people determine the nutritional information of their actual serving size if it is different from that given on the food label? Why have beverage manufacturers already made such changes to their labels even though the changes will not be..
How are furnace clearances determined : Can mastic be used for duct board that will be used as plenums ?
Identify the structures that are unique : Compare organelles in both plant and animal cells. Identify the structures that are unique to each type of cell? HINT:There areONLY four (4)unique structures for plant cells and ONLY two (2) unique structures for animal cells.
What is the minimum current rating for the disconnect switch : An electric furnace has a minimum circuit ampacity rating of 50 A. What is the minimum current rating for the disconnect switch?
Design an abstract class named bankaccount : Design an abstract class named BankAccount to hold the following data for a bank account: -Balance -Number of deposits this month -Number of withdrawals -Annual interest rate -Monthly service charges.
Difference between and haploid number and a ploidy number : What is the difference between and haploid number and a ploidy number, and how do you determine them?
How is the power wire sized for an electric furnace : How is the power wire sized for an electric furnace?
Root system to the leaves within a plant : Which properties of water allow for it to be transported from the root system to the leaves within a plant?
How can an electric baseboard heater be cleaned : Why are hydronic furnaces popular in geographical areas that do not require air conditioning?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  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.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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