Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

deposit.txt includes the value 100.00 124.00 78.92 37.55 withdrawls.txt includes the value 29.88 110.00 27.52 50.00 12.90 the UML diagram is provided in the picture

image text in transcribedimage text in transcribed

deposit.txt includes the value

100.00 124.00 78.92 37.55

withdrawls.txt includes the value

29.88 110.00 27.52 50.00 12.90

the UML diagram is provided in the picture above

use java code thank you

Bank Account Class a) Use the UML diagram in the file BankAccount.pdf attached below to implement a BankAccount class that stores a bank account's annual interest rate and balance (money in the bank account). The class constructor should accept the amount of the savings account's starting balance and the annual interest rate. The class should also have accessor and mutator methods for the balance, and for the interest rate fields. a method for subtracting the amount of a withdrawal, a method for adding the amount of a deposit, a method for adding the amount of monthly interest to the balance. The monthly interest rate is the annual interest rate divided by twelve. To add the monthly interest to the balance, multiply the monthly interest rate by the balance, and add the result to the balance. b) Write a test program that creates one bank account. The starting balance at the beginning of February is $500. The annual interest rate is 3% (0.03). 1. The program reads each deposit made in February from the Deposits.txt file (as attached) and uses the appropriate instance method to add it to the account balance. 2. The program reads each withdrawal made in February from the Withdrawals.txt file (as attached) and uses the appropriate instance method to subtract it from the account balance. 3. The program calls the instance method to add the monthly interest. 4. The program displays the balance at the end of February. To better test your program also display the starting balance, and the balance after each deposit and after each withdrawal. (name of the class) BankAccount (fields and their data types, private or public) balance : double interestRate : double (methods; their return types, their parameters, private or public) BankAccount (startBalance : double, interest : double) + getBalance (): double setBalane (newBalance : double): void + getinterestRate(): double + setInterestRate (newInterest : double) : void + withdraw (amount : double) : void + deposit (amount : double):void + add MonthlyInterest(): void (Il add monthly interest amount to the balance)

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

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago