Question: 1) Write a complete program that will have a main function and a function called average (Ref: slides 68 and 69 of lecW9 arrays, slides

 1) Write a complete program that will have a main function

1) Write a complete program that will have a main function and a function called average (Ref: slides 68 and 69 of lecW9 arrays, slides 47 to 49 of lecW6 fiunc) a. Function average will only have a 2D integer array parameter with 2 rows and 3 col- umns. This function will returm the average of the elements stored in 2D array. Use nested counter-controlled for loop. (Use array template instead of built-in array) b. In main), declare a 2D integer array template called I with 2 rows and 3 columns. c. In main0, initialize the array using initializer list such that: First row will have values 1. 2, 3 (from left to right) Second row will have values 6, 8, 0 (from left to right) stored in array t that variable. d. Call the function average from main such that it will return the average of the elements e. In main0. store the value returned from the function average in a variable. Then, print 2) Write a complete program that will do the following: a) Declare an empty integer vector (without mentioning any size). b) Use a loop to read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read from user, validate it (i.e. check whether it is between 10 and 100) c) Store the valid number in the vector only if it isn't a duplicate of a number already in vec- tor. Use push back function to add each unique value to the vector d) Display only the unique valid values that the user entered. (Hint: print vector)

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!