Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A cash register keeps three log files: customers.txt , payments.txt and taxes.txt . Together, the files compose the transactions run on the register. Write some
A cash register keeps three log files: customers.txt payments.txt and taxes.txt Together, the files compose the transactions run on the register.
Write some code that reads the files line by line and displays for each $ Make sure to display when there is bad data in any of the files with a and to display a message if any of the files are missing.
In the case of customers.txt if the line is empty display ; in the case of payments.txt if the line is not a number or is empty display ; in the case of taxes.txt if the line is not a number, is a number but not between and or is empty display
Sample Run everything ok
James Stirling, $
Mark Lucas, $
Sherley Moss, $
Sample Run bad data
James Stirling, $
Mark Lucas, $
Sherley Moss, $
$
Sample Run missing file
Could not open register files.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started