Question
5. 6. Final challenge For your final challenge in this unit, you will load two files. The first file F1 will have information about some
5. 6. Final challenge For your final challenge in this unit, you will load two files. The first file F1 will have information about some accounts. It will be pipe-delimited and have one record per line, with these fields: ACCOUNT NUMBER | PIN CODE | BALANCE The second file F2 will contain instructions: one on each line. The instructions will look like this: COMMAND | AMOUNT | ACCOUNT NUMBER | PIN CODE COMMAND will be either add or sub. If the command is add, you will add AMOUNT to the BALANCE in the account files F1. If the command is sub, you will subtract. However, there are a number of reasons for which you may need to reject the transaction. If you are asked to subtract an amount that would put the account below zero or if the pin code you are provided does not match the pin code in the account record, the transaction is ignored.
Account Transactions Given pipe-delimited files F1 and F2 where F1 contains accounts with fields ACCOUNT NUM|PIN|BALANCE and F2 contains transaction instructions COMMAND|AMOUNT|ACCOUNT NUM|PIN, execute the transactions, storing the results back in F1. The COMMAND field will be add or sub indicating addition or subtraction from the account. Transactions which do not provide the correct PIN code or attempt to put the account below zero should be ignored.
Please run the code in codio to ensure it is correct. I keep getting a syntax error and it says I have not defined orderedDict().
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