Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Do While loop that allows the user to enter floating point numbers greater than 0 and sums these numbers and prints the sum

Write a Do While loop that allows the user to enter floating point numbers greater than 0 and sums these numbers and prints the sum after the loop. The loop should exit after a number less than or equal to 0 is entered. Please do not add in values less than or equal to zero.

Sample Output #1:

Enter Positive Number to Add or Enter Zero or Negative Number to End: 99.0 Enter Positive Number to Add or Enter Zero or Negative Number to End: 67.5 Enter Positive Number to Add or Enter Zero or Negative Number to End: 0 Sum of Entered Numbers: 166.5

Sample Output #2:

Enter Positive Number to Add or Enter Zero or Negative Number to End: -1 Sum of Entered Numbers: 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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Salary (if known)

Answered: 1 week ago