11.8 Programming Activity 1: Reading from a Structured Text File

In this activity, you will read from a text file using an end-of-file controlled while loop performing this activity:

Read a text file containing transaction items for a bank account. Loop through all the transaction items and calculate the new balance of the bank account. Assume that we do not know the number of transaction items (i.e., lines) in the file.

The framework will display the current transaction and current balance so that you can check the correctness of your code as the program executes.

Figure 11.14Animation Showing a $200 Check and the New Balance

For example, ...

Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.