
11.5 Programming Activity 1: Reading from a Structured Text File 779
■
Begin with a checkbook balance of 0.00.
■
To process the transactions, you will need to read one line at a time
from the transactions.txt file and parse the String that you retrieve.You
can use the StringTokenizer class for this. The delimiter will be a colon.
Then process the transaction; you do not need to check the type of
transaction. Just add the amount of the transaction to the checkbook
balance. Adding a negative transaction amount will decrease the bal-
ance, as expected. Be sure to use try/catch blocks where appropriate.
■
After you have processed each transaction, call the ...