Answer:
total = 0
while True:
number = float(input("Enter a number: "))
if number < 0:
break
total += number
print("The total of the positive numbers entered is", total)
Step-by-step explanation:
*The code is in Python.
Initialize the total as 0
Create a while loop. Inside the loop:
Ask the user to enter a number. Check the number. If it is smaller than 0 (This means it is a negative number), stop the loop using break. Add the number to the total (cumulative sum). (This way your program keeps summing numbers until you enter a negative number)
When the loop is done, print the total