a clinical study was done that measured the heights in inches of 10 basketball playe 5150335

A clinical study was done that measured the heights (in inches) of 10 basketball players in the NBA. Write a program that uses a loop to read the names and heights from the keyboard and store the names and heights in two arrays (use string and double as variable types respectively). When done, the C++ program should:

a. Calculate and display the average height of the ten players. [10]

b. Calculate and display the shortest and tallest player (include player names).[10]

c. Sort all the players in ascending height order and display sorted players with height.[20]

d. Provide the user with the option to write all calculated results of part a, b and c to the screen or output file (NBA-Stat.txt).[10]

2. [50%] Rewrite Part 1 C++ Program using the following function prototypes:

a. void getPlayerData(string names[],double heights[], int numPlayers); //Reads input data

b. double getAverage(double heights[], int numPlayers); //Returns the average height.

c. void getShortestTallest(double heights[], double &shortest_index, double &tallest_index); //finds index of tallest and shortest players.

d. void sortByHeight(string names[],double heights[],int numPlayers); //Sorts the arrays by height.

e. Void display(string names[], double heights[],int numPlayers); //Display results on screen

f. void generateFileReport(ofstream &outFile, string names[],double heights, int numPlayers);//Writes results to output file – Note that file is opened and closed in main()

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now