May 2021 1 65 Report
Java Assignment 2, $10 via paypal for best "correct" answer...?

Savings Account program.

A bank might use several account classes to represent customers’ bank accounts. All customers at this bank can deposit money into their accounts and withdraw money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction. Money market accounts earn interest on the money they hold, however, charge a flat fee if the balances are below certain amount.

For this assignment, you need to create a class to represent the savings account and write a client program to test it.

Write the class definition SavingsAccount

Private instance data members: accountNumber, firstName, lastName, and savingsBalance (indicating the amount the saver currently has on deposit).

Private static data member: annualInterestRate(storing the annual interest rate for all account holders)

Account’s constructor should initialize instance data members (not static data members). Ensure that the SavingsBalance containing the positive value.

Public setters and getters for private instance data members.

(*** For accountNumber and savingsBalance, should we provide public setters???)

Three public instance methods:

Method deposit should add an amount to the current balance. Ensure that a negative value should not be added to the current balance.

Method withdraw should withdraw money from the Account and ensure that the withdrawal amount does not exceed the current balance.

Method calculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance.

Static method modifyInterestRate that sets the annualInterestRate to a specific value.

toString method.

Write a client program that uses the SavingsAccount class to simulate the bank transactions.

Additional requirements:

Use “Javadoc” comments and tags to document the SavingsAccount class.

Incorporate “this” reference in the SavingsAccount class.

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 QUIZLS.COM - All rights reserved.