Write a complete C++ program using an array of structs to do the following: Read
ID: 3621577 • Letter: W
Question
Write a complete C++ program using an array of structs to do the following:Read an arbitrary but fixed number “n” of input records from the text file survey.dat each containing survey results consisting of a unique integer identifier for a customer followed by a single integer rating in the range 1-10 inclusive representing that customer's rating for a newly-marketed product. After all values have been read and stored, sort the table of values by customer ID and print to the text file results.out the following information:
(a) the table contents sorted by customer ID suitably labeled.
(b) the arithmetic mean of the ratings, suitably labeled.
(c) the harmonic mean of the ratings, suitably labeled.
(d) the median value of the ratings, suitably labeled (the array of survey information will need to be re-sorted prior to determining the median value, this time using the rating as the sort key).
(e) the mode of the ratings, suitably labeled, followed by a list of cus- tomer IDs whose ratings were equal to that mode value.
Hint: Set the value of "n" in your program to 30