Question: Write compile and run a Python program that simulates an adding machine. Input to the program will be integers, submitted one per line Input should
Write compile and run a Python program that simulates an adding machine. Input to the program will be integers, submitted one per line Input should be handled as follows: a nonzero value should be added into a subtotal; a zero value should cause the subtotal to be printed and reset to zero, two consecutive zeroes should cause the total of all the values input to be printed and the program to be terminated. You are NOT required to use functions for this assignment Here's an example of how the program should work. subtotal: 11 subtotal: 0 13 -13 subtotal: 8 total: 19 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 subtotal:0 total: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
