java code and output screenshots.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Need java code and output screenshots.

A store owner keeps a record of daily
transactions in a text file. Each line contains three
items: The invoice number, the cash amount, and
the letter P if the amount was paid or R if the
amount was received. Items on each line are
separated by spaces. Write a program that
prompts the store owner for the amount of cash
at the beginning of the day and for the amount of
cash at the end of the day, as well as the name of
the ledger text file. Your program should
calculate if the actual amount of cash at the end
of the day equals the expected value. If an error
is found while opening the text file, the user
should be allowed to choose another file.
Call your program BalanceTransactions.java.
Use a transactions.txt file to test with the
following lines:
10001 56.67 P
10002 23.67R
10003 99.50 R
10004 10.95 P
Transcribed Image Text:A store owner keeps a record of daily transactions in a text file. Each line contains three items: The invoice number, the cash amount, and the letter P if the amount was paid or R if the amount was received. Items on each line are separated by spaces. Write a program that prompts the store owner for the amount of cash at the beginning of the day and for the amount of cash at the end of the day, as well as the name of the ledger text file. Your program should calculate if the actual amount of cash at the end of the day equals the expected value. If an error is found while opening the text file, the user should be allowed to choose another file. Call your program BalanceTransactions.java. Use a transactions.txt file to test with the following lines: 10001 56.67 P 10002 23.67R 10003 99.50 R 10004 10.95 P
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning