Use notepad or another text editor to create a text file named deposits.txt. The file should contain the following numbers, one per line:
100.00 124.00 78.92 37.55
Next, create a text file named withdrawals.txt. The file should contain the following numbers, one per line:
29.88 110.00 27.52 50.00 12.90
The numbers in the deposits.txt file are the amounts of deposits that were made to a savings account during the month, and the numbers in the withdrawals.txt file are the amounts of withdrawals that were made during the month. Write a program that creates an instance of the SavingsAccount class that you wrote in the programming challenge 10. The starting balance for the object is 500.00. The program should read the values from the Deposits.txt file and use the object's method to add them to the account balance. The program should read the values from the Withdrawals.txt file and use the object's method to subtract them from the account balance. The program should call the class method to calculate the monthly interest, and then display the ending balance and the total interest earned.
This exercise will use java 8 to to calculate the totals of withdrawals and deposits from a file. If you cannot use java 8, you can read all the lines of the file and then call the deposit or withdrawal for each line item.