Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions