Question: C ONLY PLEASE- using functions Write a program that prompts the user to enter the population of ten provinces of Canada and stores them in

C ONLY PLEASE- using functions

Write a program that prompts the user to enter the population of ten provinces of Canada and stores them in an array called population of size 10. It then (1) finds the average population of all provinces in Canada using function findAverage (2) finds the province with the highest population using function findHighest. prototypes of the two functions is given below. Your program must use these functions. You may define and use other functions if necessary. Follow the sample input / output for further clarification

/* findAverage takes as input an array that stores population of 10 provinces of Canada. It calculates and returns the average to main */

double findAverage(double [10]);

/* findHighest takes as input an array that stores population of 10 provinces in Canada. It finds and returns the highest population. It als outputs to main the index with the highest population */

double findHighest (double [10], int *);

Sample Input: (Note that these values are all entered in main)

Enter the population of 10 provinces of Canada (in million):

Province number 1: 4.6

Province number 2: 1.3

Province number 3: 7.5

Province number 4: 9.4

Province number 5: 5.3

Province number 6: 13.6

Province number 7: 1.5

Province number 8: 8.2

Province number 9: 1.1

Province number 10: 4.1

Output:

**************************************************

Average Population in Canada = 5.66 million

Province number 6 has the highest population

Highest population = 13.60 million

**************************************************

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!