C program using loops Make a simple checkbook balancer that would input a sequence of deposits (positive floating-point values) and issuances (negative floating-point values) terminated by a 0. It would output the transaction type, the amount and the running balance for each entry. Assume the initial balance of 0. Ensure that the issued check won’t bounce!
C
Make a simple checkbook balancer that would input a sequence of deposits (positive floating-point values) and issuances (negative floating-point values) terminated by a 0. It would output the transaction type, the amount and the running balance for each entry. Assume the initial balance of 0. Ensure that the issued check won’t bounce!
For example:
Input | Result |
---|---|
1000 -500 0 |
Transaction: Deposit Amount entered: 1000.00 Remaining balance: 1000.00 Transaction: Issuance Amount entered: 500.00 Remaining balance: 500.00 |
1000 -500 -800 500 0 |
Transaction: Deposit Amount entered: 1000.00 Remaining balance: 1000.00 Transaction: Issuance Amount entered: 500.00 Remaining balance: 500.00 Check will bounce! Transaction: Deposit Amount entered: 500.00 Remaining balance: 1000.00 |
Step by step
Solved in 2 steps with 4 images