Design an abstract class named bankaccount

Assignment Help Computer Engineering
Reference no: EM131274275

ASSIGNMENT:

Design an abstract class named BankAccount (java file called BankAccount.java) with the (exact) following fields and methods (these names and caps exactly):

Filed/Method Description
Balance
NumberDeposits
NumberWithdrawals
The bank account balance
The number of deposits this month
The number of withdrawals this month
AnnualInterestRate
The annual interest rate
MonthlyServiceCharge

The monthly service charge

BankAccount A constructor method that accepts as arguments the balance and the annual
SetMonthlyServiceCharges
GetBalance
GetNumberDeposits
GetNumberWithdrawals
interest rate

A method that accepts the monthly service charges as an argument and set the field value
A method that returns the bank account balance
A method that returns the number of deposits this month
A method that returns the number of withdrawals this month

GetAnnualInterestRate

A method that returns the annual interest rate
GetMonthlyServiceCharge
Deposit
Withdrawal
CalculateInterest
MonthlyProcess

A method that returns the monthly service charge

A method that accepts the amount of the deposit as an argument, add the value of that argument to the account balance, and increment the variable holding the number of deposits.

A method that accepts the amount of the withdrawal as an argument, subtracts that argument value from the balance, and increment the value holding the number of withdrawals.

A method that updates the balance by calculating the monthly interest earned by the account, and adding this interest to the balance
A method that subtracts the monthly service charges from the balance, callas

The CalculateInterest method to calculate the interest, and then sets to 0 the variables for NumberDeposits, NumberWithdrawals, and MonthlyServiceCharge

Next, design another class named SavingsAccount (java file called SavingsAccount.java) that extends the BankAccount class. This class should have the (exact) following fields and methods (these names and caps exactly)

Filed/Method Description
Status

A private (Boolean) field that holds the account status: if it is active or inactive. If the balance of the account falls below $25, the account becomes inactive. No withdrawals can be made from an inactive account.

SavingsAccount A constructor method that accepts as arguments the account balance, the annual interest rate, and the monthly service charge. Based on the account balance, the constructor should set the account Status to true or false.

Deposit

Withdrawal
MonthlyProcess

A method that calls the superclass version of the Deposit method, to make a deposit and then updates the Status of the accounts if the balance goes above $25.

A method that checks if the status of the account is active, and, if that is true, calls the superclass version of the Withdrawal method, to make an withdrawal from the account. The method should update the Status if the balance goes under $25.

A method that does the monthly process based on the number of withdrawals from the account.

If the number of withdrawals for the month is less or equal to 4, the method calls the superclass version of the MonthlyProcess method, to do the monthly process.

If the number of withdrawals for the month is more than 4, then a service charge of $1 for each withdrawal above 4 (e.g. $1 for 5, $2 for 6, etc.) is added to the superclass field that holds the monthly service charge (using the superclass SetMonthlyServiceCharges). Then, the method calls the superclass version of the MonthlyProcess method, to do the monthly process.

Document your program (meaning follow the Assignment Code Convention, explain what each line of code does).

For 10 points extra credit, create a program/project called [YourName]-Assignment9 (replace [YourName] with your actual name) in the same project as the BankAccount.java and SavingsAccount.java .that create a SavingsAccount objects and demonstrate the methods (and different cases)

GetBalance, GetNumberDeposits,

GetNumberWithdrawals, GetAnnualInterestRate, GetMonthlyServiceCharge, Deposit, Withdrawal,

CalculateInterest, and MonthlyProcess for the particular SavingsAccount object. Take a screenshot of the editor window (showing the source code and the output) and save it as [YourName]-Screenshot (make sure you preserve the image file extension) or paste it in a document called [YourName]-Screenshot. Replace

[YourName] with your actual name.

You can earn/loose additional points according to the following table:

+10 For writing the driver class [YourName]-Assignment9 with requested methods
-5 For not documenting your code (should have a comment for each line of code , field, method, class, program, etc)
-5 For not using the correct program name or file name that does not have your name in it
-5 For not submitting the correct files
-30 For hardcoding the results ; i.e. printing out the expected results instead of computing the values and then outputting the computed values
-50 For cheating.

Reference no: EM131274275

Questions Cloud

Consultant hired by ge top management : Imagine that you are a consultant hired by GE's top management to help them in their future strategic planning. You have been asked to develop a report for GE's Board of Directors.
Create a cpp application that will store and retrieve names : Create a C++ console application that will store and retrieve names and addresses in a text file. The program should do the following. It should accept a series of names and addresses from the console.
Service characteristic of intangibility : Does the service characteristic of intangibility, inseperability, heterogeneity, and/or perishability change once a service is placed on the web?
Research the culture of the chosen city : Choose a city in one of the following countries: Taiwan, Spain, Uruguay, Australia, or Turkey. Research the culture of the chosen city and write a one- to two-page essay to describe what you need to know about three cultural differences that would..
Design an abstract class named bankaccount : Design an abstract class named BankAccount (java file called BankAccount.java) with the (exact) following fields and methods (these names and caps exactly).
Continuous improvement models : In approx. 150 words for each point below, explain how each of the following can be incorporated into business systems:
Ensure that systems and processes : You have been asked develop strategies to ensure that systems and processes and used to monitor operational progress and to identify ways in which planning and operations could be improved.
What is the product of the numbers : Three distinct prime numbers, less than 10 are taken and all the numbers that can be formed by arranging all the digits are taken. Now, difference between the largest and the smallest number formed is equal to 495. It is also given that sum of the di..
Program that plays a commercial video continuously : Determine the type of loop that you would use in your program in order to make the video play continuously. Provide a rationale for your chosen type of loop.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down a program to assign the integer values 1 through

write a program to assign the integer values 1 through 25 to a 25 element integer array. then print the array as five

  Questionwrite down program for a bank account starts out

questionwrite down program for a bank account starts out with user selectable .interest is compounded monthly at user

  Write down a program that inputs a word

Write down a program that inputs a word from the keyboard and determines the length of the word. Print the word using twice the length as the field width.

  Converting the sum of elements of array into octal format

Provided an array of ints named x and an int variable named total that has already been declared, write down some code which places the sum of all the elements of the array x into total.

  Give a variable whose value is a letter grade

suppose that grade is a variable whose value is a letter grade-- any one of the following letters: 'A', 'B', 'C', 'D', 'E', 'F', 'W', 'I'. Assume further that there are the following int variables, declared and already initialized: acount, bcount,..

  The dynamic programming algorithm

How many different optimal subsets does the instance of part (a) have - how can we use the table generated by the dynamic programming algorithm to tell whether there is more than one optimal subset for the knapsack problem's instance?

  What kind of algorithm is required

figuring out how to find the last element of the print statement. For array A(N) and input element ARG, what kind of algorithm is needed to determine which element of A(N) is closest to but not greater than ARG? I've gotten this far but can't find..

  Which skills are employers seeking

Beyond the technical skills your degree does/will provide, what other skills are employers seeking? Have a look at job advertisments such as those in CareerOne. Other than technical skills, which skills are employers seeking?

  What are two merits and two challenges which might be faced

based on the barr 2013 article what are three possible ways that streaming media can be used to accomplish the

  Rules of inference to show that the hypotheses

Use rules of inference to show that the hypotheses "If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on,"

  Create a gantt chart and pert chart in a project management

Create a Gantt chart and a PERT chart in a project management tool (e.g., Microsoft Project), or use a spreadsheet package to graphically show the high-level tasks of the project.

  General approach is to encourage timely communication news

The general approach is to encourage timely communication of news (positive or negative) to project stakeholders. However, can you envisage situations where it may be required , or even advantageous, for project management to suppress the dissemin..

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