This will be a simple translation into pseudocode. Since this is homework, you will have to deal with legalization yourself. Just evaluate each step in turn:
input: accountBalanceStart, totalDeposits, totalWithdrawals
output: accountBalanceEnd
Take the first step:
accountBalanceEnd <-- accountBalanceStart - totalWithdrawals
Now the second:
accountBalanceEnd <-- accountBalanceEnd + totalDeposits
Then calculate the tax and subtract it:
accountBalanceEnd <-- accountBalanceEnd - (totalWithdrawals + totalDeposits) * 0.01
Finally, show the result:
print accountBalanceEnd
source
share