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

  Write a program using binary search approach

Write a program using binary search approach

  Describing program using suiatble printf command

Yyou have to describe all of this to user using suiatble printf() statements.

  Cooks selected by methods are different which one is taller

He orders the shortest man in each column to step aside and chooses the tallest of these twenty-five. The two cooks chosen by the two methods are different. Which one is taller?

  Implement ref integ result in data duplication

Would failure to implement Ref Integ result in data duplication, incorrect data sets, or broken table errors or is there a work around.

  Design logic that continuously prompt user for numeric value

Design the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to a method that squares the number

  Write pseudocode to accept candy name

Write a pseudocode for the following: A programm to accept a candy name (for exmple, "chocolate-covered blueberries'), price per pound, and number of pounds sold.

  Write a web application which will give report of balance

Write a web application which will provide a report of the balance held in the visitor's account during the past several months.

  Write lisp function to reverse order of the elements in list

Write a Lisp function that: given a two-element list, reverse the order of the elements in the list (cannot use the LISP reverse function).

  Creating loop to find number of items bought based on price

Make a block using a loop that will find the number of items that can be bought based on the price of the item and the total amount available to spend.

  Write parameterized function to play the game

Your program cannot use file level variables or constants; your program cannot use global variables or constants. The functions that you write exchange data by means of return statements and value parameters and reference parameters

  Write script to get gross sales for each employee by xhtml

Use a one-dimensional array to solve the folloing problem: Write a script (using an array of counters) that obtains the gross sales for each employee through an XHTML form and determines how many of the salespeople earned salaries

  Explaining valid advice for naming variables

Which of the following is valid advice for naming variables? To save typing, make most variable names one or two letters.

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