Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal: Practice how to create user-defined classes in Java. Enhance the BankAccount class and see how abstraction and encapsulation enable evolutionary changes to software: Begin

Goal: Practice how to create user-defined classes in Java. Enhance the BankAccount class and see how abstraction and encapsulation enable evolutionary changes to software: Begin with a simple enhancement: charging a fee for every deposit and withdrawal. Supply a mechanism for setting the fee and modify the deposit and withdraw methods so that the fee is levied. The initial transaction fee is 50 cents, and this can be changed later on. Test your class and check that the fee is computed correctly. Now make a more complex change. The bank will allow a fixed number of free transactions (deposits and withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at the enimage text in transcribedd of the month. The initial value for the number of free transactions is 10. Supply a new method deductMonthlyCharge to the BankAccount class that deducts the monthly charge and resets the transaction count. (Hint: Use Math.max(actual transaction count , free transaction count) in your computation.) Write a tester Java program that verifies that the fees are calculated correctly over several months.

Problem 5. (9 points) Goal: Practice how to create user-defined classes in Java. Enhance the BankAccount class and see how abstraction and encapsulation enable evolutionary changes to software: Begin with a simple enhancement: charging a fee for every deposit and withdrawal. Supply a mechanism for setting the fee and modify the deposit and withdraw methods so that the fee is levied. The initial transaction fee is 50 cents, and this can be changed later on. Test your class and check that the fee is computed correctly. Now make a more complex change. The bank will allow a fixed number of free transactions (deposits and withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at the end of the month. The initial value for the number of free transactions is 10. Supply a new method deductMonthlyCharge to the BankAccount class that deducts the monthly charge and resets the transaction count. (Hint: Use Math.max (actual transaction count , free transaction count) in your computation.) Write a tester Java program that verifies that the fees are calculated correctly over several months. Problem 5. (9 points) Goal: Practice how to create user-defined classes in Java. Enhance the BankAccount class and see how abstraction and encapsulation enable evolutionary changes to software: Begin with a simple enhancement: charging a fee for every deposit and withdrawal. Supply a mechanism for setting the fee and modify the deposit and withdraw methods so that the fee is levied. The initial transaction fee is 50 cents, and this can be changed later on. Test your class and check that the fee is computed correctly. Now make a more complex change. The bank will allow a fixed number of free transactions (deposits and withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at the end of the month. The initial value for the number of free transactions is 10. Supply a new method deductMonthlyCharge to the BankAccount class that deducts the monthly charge and resets the transaction count. (Hint: Use Math.max (actual transaction count , free transaction count) in your computation.) Write a tester Java program that verifies that the fees are calculated correctly over several months

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions