Question: python Exercise # 2: Write a program that given a collection of N numbers will find the largest value, its frequency and the average of

python  python Exercise # 2: Write a program that given a collection
of N numbers will find the largest value, its frequency and the

Exercise # 2: Write a program that given a collection of N numbers will find the largest value, its frequency and the average of the N numbers Get the value of N from the user IN S 0 display an appropriate orror message and terminate the program, otherwise Read the values as entered from the user (N = 5, then there are 5 values the user is going to enter) Find the largest its frequency how many times it is repeated) and the average of these values Hint To find the largest value, read the first value before the loop then assume that this first value entered by the user is the largest value. Within the loop compare the assumed fargest value with other values read inside the loop and change the largest value accordingly Sample Runs Enter how many values to consider: -2 Wrong input. Input must be > 0 Enter how many values to consider: 4 Enter value 1: -3 Enter value 2: -10 Enter value 3: -7 Enter value 4: -3 Maximum value- -3 It's frequency is 2 Average = -5.75 Enter how many values to consider: 7 Enter value 1: 4 Enter value 2: 3 Enter value 3: 2 Enter value 4: 1 Enter value 5: 2 Enter value 6: 3 Enter value 7: 5 Maximum value= 5 It's frequency is 1 Average 2.86

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!