Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

There has been a substantial interest in predictability of

There has been a substantial interest in predictability of stock return in recent years. For example, DeBondt and Thaler (1985, 1987) report that long-term past losers (three- to five-years) outperform long-term past win ...

Suppose you are writing software for a radio station that

Suppose you are writing software for a radio station that manages its playlists. The program will generate candidate playlists from a record library automatically and station personnel can then check and modifythem. Disc ...

Recently the discovery of a new data structure wonder heap

Recently, the discovery of a new data structure WONDER HEAP was announced. A WONDER HEAP has the same functionality and worst case behaviour as a binary heap except for DELETE MAX, which is implemented in O(log log n) (i ...

How many electrons in a tellurium te atom have a principal

How many electrons in a tellurium (Te) atom have a principal quantum number of n = 4 and a magnetic quantum number of m l  = 0? a)2 b) 3 c) 6 d) 9 e) 18 Why does Beryllium (Be) have a positive electron affinity? ( That i ...

A salesforce from an ecommerce global organization has

A salesforce from an ecommerce global organization has begun to raise some concerns about the orders they are transmitting over the Internet from their customers' site to the organization's global headquarters. It seems ...

What are the key nonprice factors that influence demand and

What are the key nonprice factors that influence demand and supply?

Program in cit is often times advantageous to be able to

*Program in C* It is often times advantageous to be able to transfer data between two arrays. Need a help with program (transfer.c) that add a range (by start index and end index) of numbers from array #1 to array #2 at ...

A for which hypervisors does kali linux offer custom

a. For which hypervisors does Kali Linux offer custom images? What tools must be added to a VirtualBox Kali Linux VM to provide proper integration with the host machine? b. What hypervisor comes already installed in Kali ...

Research ways that information systems have been misused

Research ways that Information Systems have been misused. Using the Internet, find an example of an organization that has misused Information Systems. Post your response to the discussion board. Respond to the following ...

Question you are shopping for a new computer you will be

Question: You are shopping for a new computer. You will be using the computer for everything you do, such as school, socializing, gaming, and communicating. Your total budget before tax is $1,000.00. Considerations: • Bu ...

  • 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