Answer:
The program in Python is as follows:
nums = []
isum = 0
num = int(input("Num: "))
while num >= 0:
isum+=num
nums.append(num)
num = int(input("Num: "))
print("Sum: ",isum)
print("Average: ",isum/len(nums))
print("Minimum: ",min(nums))
print("Maximum: ",max(nums))
Step-by-step explanation:
My solution uses list to answer the question
This initializes an empty list, num
nums = []
This initializes the sum of the input to 0
isum = 0
This prompts the user for input
num = int(input("Num: "))
The loop is repeated until the user enters a negative number
while num >= 0:
This calculates the sum of the list
isum+=num
This appends the input to the list
nums.append(num)
This prompts the user for another input
num = int(input("Num: "))
This prints the sum of the list
print("Sum: ",isum)
This prints the average of the list
print("Average: ",isum/len(nums))
This prints the minimum of the list
print("Minimum: ",min(nums))
This prints the maximum of the list
print("Maximum: ",max(nums))