Question: (For the following assignment, please answer in the most SIMPLEST FORM possible. Nothing too intricate as I am only a beginner. Label each one my

(For the following assignment, please answer in the most SIMPLEST FORM possible. Nothing too intricate as I am only a beginner.

Label each one my its exercise, so I know which one is which.

THANK YOU)

Arrays and Vectors Boot camp

Exercise 1 Write a function that reads n elements of type integer, typed by the user, into array a of integers of size n. Propose a prototype for the function. Write its code and a tester to demonstrate its use.

Exercise 2 Redo exercise 1 using vectors. The problem statement becomes: write a function that reads n elements of type integer, typed by the user, into a vector v of integers.

Exercise 3 Write a function that takes an array a of integers and its size n and displays the elements of the array separated by blank space. Propose a prototype for the function. Write its code and a tester to demonstrate its use.

Exercise 4 Redo exercise 3 using vectors. The problem statement becomes: write a function that takes a vector of integers and displays ..[]

Exercise 5 Write a function that takes an array a of integers and its size n and returns the minimum value of the array. Propose a prototype for the function. Write its code and a tester to demonstrate its use.

Exercise 6 Redo exercise 5 using vectors. The problem statement becomes: write a function that takes a vector of integers and returns the minimum value in the vector.

Exercise 7 Write a function that takes an array a of integers and its size n and returns the position (or index) of the minimum value of the array. Propose a prototype for the function. Write its code and a tester to demonstrate its use.

Exercise 8 Redo exercise 7 using vectors.

Exercise 9 Redo exercises 5, 6, 7, and 8 in which the minimum is replaced by the maximum in the corresponding problem statements.

Exercise 10 Write a function that takes a vector of integers and returns the reverse of the vector. Propose a function prototype. Write its code and a tester to demonstrate its use.

Exercise 11 Write a function that takes an array a of integers and its size n and returns the average of the remaining elements after discarding the minimum and maximum values from the array. If the minimum value appears more than once, only one instance of the minimum value is discarded. The same applies when discarding the maximum value.

Exercise 12 Redo exercise 11 using vectors.

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!