Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number

Write a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.
Input:
1.1
2.2
3.3
4.4
5.5
6.6
7.7
8.8
9.9
0
Expected output:
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Total =49.50

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago