Exercise 4: Solve the programming exercise P10.8 on Page 535 on the book. Write a program that replaces each line of a file with its reverse. For example, if you run java Reverse HelloPrinter.java then the contents of HelloPrinter.java are changed to retnirPolleH ssalc cilbup ) sgra ] [gnirts (niam diov citats cilbup wodniw elosnoc eht ni gniteerg a yalpsiD // ;)"!dlrow , olleH" (nltnirp.tuo.metsys Of course, if you run Reverse twice on the same file, you get back the original file.
Exercise 1:
Design a class Bank that contains a number of bank accounts. Each account has an account number and a
current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an
array list. Write a readFile method of the Bank class for reading a file with the format
accountNumber1, balance1
accountNumber2, balance2
…
Write a readAndPerformTransactions method of the Bank class for reading a file that describes the
transactions done by different bank accounts and perform these transactions. For example,
1234456742 withdraw 375
8686349535 deposit 850
1234456742 deposit 150
…
Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file
with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts,
print the details of the accounts after performing the transactions, and print the account with the highest balance.
![Exercise 4:
Solve the programming exercise P10.8 on Page 535 on the book.
Write a program that replaces each line of a file with its reverse. For example,
if you run
java Reverse HelloPrinter.java
then the contents of HelloPrinter.java are changed to
retnirPolleH ssalc cilbup
) sgra ] [gnirts (niam diov citats cilbup
wodniw elosnoc eht ni gniteerg a yalpsiD //
;)"!dlrow , olleH" (nltnirp.tuo.metsys
Of course, if you run Reverse twice on the same file, you get back the original
file.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F63b2fbd2-4ffb-4355-be30-95278f02c4b5%2F8e917e08-1f1a-4e74-bd16-913241ec6fdd%2F83zddi_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 9 steps with 7 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)