Question: 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

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 transactions.txt which contains the following information on each line of the file: 1. customer last name (two words followed by a comma as a delimiter) 2. checking account balance 3. transaction type code 4. transaction amount . . . Provide an appropriate error message if the file cannot be found. (2 points) Remember to echo (display) each input item as well. (5 points) A negative amount or insufficient fund should cause an error message to be written and the transaction is ignored. (5 points) Invalid transaction types must be reported as errors. (5 points) All monetary values should be printed with 2 decimal places and a dollar sign using the currency format. (5 points) You should also show the balance before and after, even if the transaction is bad or ignored. (5 points) Transaction type codes are (W)ithdraw, (D)eposit, (R)eport the balance W D R Subtract this money from the account. Allowed only if amount is positive and (less than or equal) to the balance or an error message is printed. Add this money to the account. Only positive amount is allowed. Report the current balance (amount is ignored). At the end of the transaction the program writes out the new balance and why it couldn't be done. In any case, if the ending balance is below $300, a warning message should be printed. (5 points) You need to create the input data file and use the following exact data to test your program: Joe Turing, 4124.50 D 200 Charles Babbage, 300.00 D 100 Sam Backus, 350.25 W 51 Khaled Mansour, 600.50 X 600 Robert McCarthy, 1000.00 RO Jack Atanasoff, 200.00 W 200 Anne Stroustrup, 300.75 W 310 Amanda Hollerith, 500.00 W -5 For example, the input file below: Stacy Jones, 300 D 100 Michael White, 350 W 51 might produce output as shown below: Customer Name: Jones, Stacy Checking balance before transaction $ 300.00 Transaction Type: D Transaction amount $100.00 Checking balance after transaction $ 400.00 Customer Name: White, Michael Checking balance before transaction $ 350.00 Transaction Type: W Transaction amount $51.00 Checking balance after transaction Warning: account is below minimum What to turn in: Your program.java listing copy of Output file statement.txt copy of Input file transactions.txt $ 299.00 $ 300.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
