Question: Write a c + + program for a solution that allows the user to read from a file a list of floating - point values

Write a c++ program for a solution that allows the user to read from a file a list of floating-point values and store them in an array. The program will have a separate function to find the mean (add all the values and then divide by the number of values), median (middle value if there is an odd number, or the mean of the middle 2 if there are an even number of values) the smallest value, the largest value, the kth largest value (this requires the user to enter k, Example if user enters 4 for k then find the fourth largest value), and search for a value in the list( user enters value to search for). Print out all statistics labeled and in a neat form. The solution should work for up to 100 values.
Hint: to find the median, largest, smallest, and kth largest, it is easiest to sort the values first.
The data file contains the following values:
25.65
18.59
0.0016
59.32
71.98
16.7
98.65
12.54
65.80
39.78
29.99
85.23
33.29
71.18
95.17
29.67
47.31
23.98
82.61
55.44

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 Programming Questions!