The ATM Transaction Validator requires a loop and if-then logic. You will write the output to a file called statement.txt and read in a file called customer.txt which contains the following information on each line of the file:
Customer last name (two words followed by a comma as a delimiter)
Checking account balance
Transaction type code
Provide an appropriate error message if the file cannot be found.
Remember to echo each input item as well
A negative amount should cause an error message to be written and the transaction ignored
Invalid transaction types must be reported as errors
All monetary values should be printed with 2 decimal places.
Transaction type codes are (W)ithdraw, (D)eposit, (R)eport the balance
At the end of the transaction the program writes out the new balance or why it couldn't be done.
In any case, if the ending balance is below $300, a warning message should be printed
You need to create the input data file (customer.txt) and use the following data to test your program:
Joe Turing, 4124.50 D 200
Charles Babbage, 300.00 D 100
Sam Backus, 350.25 W 51
Sam Hopper, 600.50 X 600
Robert McCarthy, 1000.00 R 0
Jack Atanasoff, 200.00 W 200
Anne Stroustrup, 300.75 W 301
Amanda Hollerith, 500.00 W -2