Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DELIVERABLE Submit a single zipfile to the MyCourses HW4 dropbox. Homework MUST be submitted on time to receive full credit. Homework submitted to the late

image text in transcribedimage text in transcribedimage text in transcribed

DELIVERABLE Submit a single zipfile to the MyCourses HW4 dropbox. Homework MUST be submitted on time to receive full credit. Homework submitted to the "late" dropbox will receive a maximum grade of 80%. Homework not submitted to a dropbox will receive no credit. ASSIGNMENT Based on earlier course material, this assignment will enhance BankAccount to demonstrate how abstraction and encapsulation enable evolutionary software changes Start with the version of BankAccount.java in the Downloads for HW04 from the myCourses HW04 content area. Begin by incorporating a transaction (service) fee for every deposit and withdrawal. Supply a setTransFee mutator method for setting a fee charged for every transaction and modify the deposit and withdraw methods so that the fee is levied. Test the resulting class and check that the fee is computed correctly Before continuing, remove the changes made to the deposit and withdraw methods but keep the attribute and the mutator. Now make a more complex change. The bank will allow a fixed number of free transactions (deposits or withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at the end of the month. Supply another mutator method called setNumFreeTrans ) that sets the ree transactions number. Declare, initialize, and increment a transaction count attribute. Increment this count for each transaction Supply a new, deductMonthlyCharge (), method to the BankAccount class called that deducts the monthly charge from the account balance, but only if the number of free transactions is exceeded, and then resets the transaction count. Hint Use the max method from the Math class Math.max (actual transaction count, free transaction count) Think about what the simple formula should be? Do NOT use an if statement. Design a test 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_2

Step: 3

blur-text-image_3

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions