Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92028997
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As