In: Computer Science
Design a complete program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display each of the following data:
I. The lowest number in the array
II. The highest number in the array
III. The total of the numbers in the array
IV. The average of the numbers in the array
*PYTHON NOT PSUEDOCODE AND FLOW CHART!!!!*
def printResults(data):
total=0
minN=data[0]
maxN=data[0]
for x in data:
total=total+data[0]
if x >maxN:
maxN=x
if x < minN:
minN=x
avg=total/len(data)
print("Sum: ",total)
print("Avg: ",avg)
print("Max: ",maxN)
print("Min: ",minN)
data=[]
print("Enter 20 integers")
for i in range(0,20):
data.append(int(input("")))
printResults(data)
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me