Question: Exercise 2 Write a program that given a collection of Numbers will find the largest value is frequency and the average of the numbers Get

 Exercise 2 Write a program that given a collection of Numbers

Exercise 2 Write a program that given a collection of Numbers will find the largest value is frequency and the average of the numbers Get the value of N from the user IN 50 display an appropriate error message and terminate the programeotherwise Read the values as entered from the user (If N = 5, then there are values the user is going to me Find the largest its frequency (how many times is repeated) and the average of these values You need to use FOR loop along with conditional statements Hint. To find the largest Value read the first value before the loop then assume that the first Value entered by the user is the rest van within the loop compare the assumed largest valile with other values read inside the loop and change the largest occordingly Sample Runs Enter how many values to consider: 2 Wrong input Input must be > Enter how many values to consider: 4 Enter value 1: -3 Enter value 2: -10 Enter value 3: -7 Enter value 4.3 Maximum values -3 It's frequency 15 2 Average -5.75

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!