The while Problem 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++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
icon
Related questions
icon
Concept explainers
Question

Exercise I for the while Loop

The while Problem

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
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
Transaction: Deposit
-500
Amount entered: 1000.00
Remaining balance: 1000.00
Transaction: Issuance
Amount entered: 500.00
Remaining balance: 500.00
1000
Transaction: Deposit
-500
Amount entered: 1000.00
-800
Remaining balance: 1000.00
500
Transaction: Issuance
Amount entered: 500.00
Remaining balance: 500.00
Check will bounce!
Transaction: Deposit
Amount entered: 500.00
Remaining balance: 1000.00
Answer: (penalty regime: 10, 20, . %)
Transcribed Image Text: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 Transaction: Deposit -500 Amount entered: 1000.00 Remaining balance: 1000.00 Transaction: Issuance Amount entered: 500.00 Remaining balance: 500.00 1000 Transaction: Deposit -500 Amount entered: 1000.00 -800 Remaining balance: 1000.00 500 Transaction: Issuance Amount entered: 500.00 Remaining balance: 500.00 Check will bounce! Transaction: Deposit Amount entered: 500.00 Remaining balance: 1000.00 Answer: (penalty regime: 10, 20, . %)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning