Question: In Python Adding Calculator Write a program that simulates an adding machine. Input to the program will be integers, submitted one per line. Input should

In Python


Adding Calculator Write a program that simulates an adding machine. Input to

 


Adding Calculator Write a program that simulates an adding machine. Input to the program will be integers, submitted one per line. Input should be handled as follows: 1. a nonzero value should be added into a subtotal; 2. a zero value should cause the subtotal to be printed and reset to zero; 3. two consecutive zeroes should cause the total (not subtotal) of all the values input to be printed and the program to be terminated. Here's an example of how the program should work. Input is in red and output is in blue. Beginning of output: 6 59 subtotal: 11 0 -3 -2 5 0 13 subtotal: 0. -13 8 0 subtotal: 8 0 total: 19 End of Output Test your program on input that consists of two zeroes-the output should be a 0 subtotal and a 0 total-as well as on the example above. Here's an example: 0 subtotal: 0 0 total: 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It appears that the question image contains incomplete information The image describes the requireme... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!