Create classes for account and savingsaccount

Assignment Help Programming Languages
Reference no: EM1366619

Design and write 3 classes - Account, CheckingAccount, and SavingsAccount. Have CheckingAccount and SavingsAccount inherit from Account. In Account, you should include an account number, an account balance, a deposit and toString method, and an abstract withdraw method. Since deposits work the same way in both child classes, make sure they cannot override it. The constructor should only take an initial deposit and generate a random 5 digit account number. The toString should display the account number and the balance. Use a NumberFormat object to format the balance.

In the CheckingAccount class add a minimum balance and overdraft fee. Implement the withdraw method so that overdrafts are allowed, but the overdraft fee is incurred if the balance drops below the minimum balance. Override the toString method to display everything the Account toString displays plus the minimum balance. Use the parent class toString to do most of the work. You should not need a NumberFormat object in this method.

In the SavingsAccount class add an annual interest rate and a method to recalculate the balance every month. Since the interest rate is annual, make sure to calculate the interest accordingly. Override the toString method to display everything the Account toString displays plus the interest rate. Like the CheckingAccount toString, you should use the parent class to do most of the work and should not need a NumberFormat object.

Create a driver class to instantiate and exercise each of the account types.

Reference no: EM1366619

Questions Cloud

Standard deviation of return : The expected returns earned from investment in the stock of two companies, Company A and Company B, are shown in the following table. Use the table to complete parts (a) through (e) below.
Determine the effective interest rate on the bonds : Shaid company issued $2,000,000 of 6 percent, ten year convertible bonds on June 1st, 1993 at 98 plus accrued interest. The bonds were dated April 1st, 1993, with interest payable April 1st and October 1se. Bond discount is amortized semiannually on ..
Create an algorithm to produce list of customers : Create an algorithm to produce list of customers from Glad Rags Clothing Company's customer master file. Each record on customer master file contains the customer's number
Disease-oriented health care system : Describe the role of health care reform in shifting the focus from a disease-oriented health care system toward one of wellness and prevention, and how does nursing fit to this shift?
Create classes for account and savingsaccount : Create and write three classes - Account, CheckingAccount, and SavingsAccount. Have CheckingAccount and SavingsAccount inherit from Account.
Changes at happy trails health center : How can adopting a systems view of human resource management help the managers responsible for implementing this main change?
How to sketch flow chart to read employee master file : How to sketch flow chart to read employee master file and to output number of employees in each department who have a basic degree.
Creating a trend line slope : Select your favorite financial site on the web. Go there and see the stock price for Coca Cola for the 1st trading day in March and April of this year. Create a trend line slope
Type of market situations : Describe in what kind of market situations (size, growth, trend, area, etc.) might each kind of managed care plan (HMO, PPO, POS, etc.) be the preferred model? Why?

Reviews

Write a Review

 

Programming Languages Questions & Answers

  Program to calculate volume flow rate in cubic feet

Write a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second.

  Determine branch folding for unconditional branches

Determine the improvement from branch folding for unconditional branches. Assume a 90% hit rate, a base CPI without unconditional branch stalls of 1.

  Design fraction class to represent numerator and denominator

Design a fraction class. The class should have 2 data members to represent the numerator and denominator. Both of these numbers should obviously be integers.

  C program to accept three numbers inputs by user

Write down C program to accept three numbers input by a user, and outputs a table of temperatures in Fahrenheit, Celsius, and Kelvin.

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

  Explaining variable in an arrays of ints

Assume that variable A is an arrays of ints. Consider the following code segment.

  Create a credit approval application for retail store

You have been asked to create a credit approval application for retail store. To get approved for credit card customer must meet the following criteria: Should be 18 years of age or older

  Explain relationship between xbrl and semantic web

How do HTML 5, RDF (Resource Description Framework), and OWL (Web Ontology Language) relate to the semantic web? Explain the relationship between XBRL and the semantic web.

  Design and implement program that creates exception class

Design and implement a program that creates an exception class called StringTooLongException, designed to be thrown when a string is discovered that has too many characters in it

  Differentiating heavyweight and lightweight process

What is the difference between a heavyweight and a lightweight process? Give an example of where heavyweight processes are appropriate.

  Create a multi-threaded competition

Create a multi-threaded competition

  Write a vhdl code for soda vending machine

Write a VHDL code that implements the above soda machine. You have to turn in the following: A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

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