Quiz
Updating Accounts
You work in a bank.
The dataset Account_Balances contains the balances for all of the accounts in your bank. The dataset Daily_Transactions contains all of the transactions your customers made today. These transactions aren’t yet reflected in the Account_Balances dataset (that’s your job!).
You need to calculate the new balance for each account at the end of the day. Note, however, that your bank does not allow for an account to have a negative balance at any time, so you must cancel any transaction that would result in the balance falling below zero, even if a later transaction would make the balance positive again. The transactions should be reflected in the order in which they were made.
In addition, create a file containing all of the transactions that had to be canceled.
1
1
1
Updating Accounts (cont.)
Here is an example of how the balance should be calculated for an account:
Starting balance: $150.45
Transaction ID Time Transaction Amount Balance
00005 08:02 Credit $75 $225.45
00291 13:39 Debit $200 $25.45
00946 15:08 Debit $50 $25.45
02081 16:15 Credit $100 $125.45
Ending Balance $125.45
Canceled Transactions (the $50 debit was canceled because it would have caused a negative balance).
Transaction_ID
00946
2
2
2
/docProps/thumbnail.jpeg