Answer to Question #306605 in C++ for Nobody

Question #306605

You are required to write a C++ program to read in one customer’s account balance at the beginning of the month, a total of all withdrawals for the month, and a total of all deposits made during the month. A federal tax charge of 1% is applied to all transactions made during the month. The program is to calculate the account balance at the end of the month by 

(1) subtracting the total withdrawals from the account balance at the beginning of the month, (2) adding the total deposits to this new balance, 

(3) calculating the federal tax (1% of total transactions, i.e.total withdrawals + total deposits), 

(4) subtracting this federal tax from the new balance. 

 

After these calculations, print the final end-of-month balance.



1
Expert's answer
2022-03-05T13:00:42-0500

This will be a straightforward translation into pseudocode. As this is a homework assignment¸ you'll have to do the legwork yourself. Just evaluate each step in turn:

input: accountBalanceStart, totalDeposits, totalWithdrawals
output: accountBalanceEnd

Let's take the first step:

accountBalanceEnd <-- accountBalanceStart - totalWithdrawals

Now the second:

accountBalanceEnd <-- accountBalanceEnd + totalDeposits

Next, compute the tax and subtract it:

accountBalanceEnd <-- accountBalanceEnd - (totalWithdrawals + totalDeposits) * 0.01

Finally, show the result:

print accountBalanceEnd

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog