Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started