Question: : Write a Java program that given a collection of N numbers will find the largest value, the frequency of the largest value (i.e., the

: Write a Java program that given a collection of N numbers will find the largest value, the frequency of the largest value (i.e., the number of times the largest value appears in the collection), and the average of the N numbers

Get the value of N from the user.

If N

Read the values as entered from the user. (If N =5, then there are 5 values the user is going to enter).

Find the Largest, the frequency of the largest value, and the average of these N values.

solution must not use arrays and data files.

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 and its frequency is 1. Within the loop compare the assumed largest value with other values read inside the loop and change the largest value and frequency accordingly.

: Write a Java program that given a collection of N numbers

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!