Question: Codio challenge python Final challenge For your final challenge in this unit, you will load two files. The first file F1 will have information about

Codio challenge python

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 subindicating 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.

# Get the filepath from the command line import sys F1= sys.argv[1] F2= sys.argv[2]

# Your code goes here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!