Question: Problem 3 (30 Points) The following main function of a C++ program calls the function mirror that mirrors the content of a pre-initialized array

Problem 3 (30 Points) The following main function of a C++ program calls the function mirror that mirrors the content of a pre-initialized array v of integers and then display the contents of the mirrored array. int main() { // Declare array int v[] = {5, 6, 7, 8, 2, 1}; // Mirror it mirror(v, 6); // Print array for (int i = 0; i < 6%; i++) cout < < v[i] < < ' '; return 0; } Implement the function mirror in C++. The function must work with any array of integers where the array size can be either odd or even. Examples of arrays mirror for both odd and even number of elements are shown below: 0 ' 2 3 4 5 6 7 8 2 R 1 2 3 4 5 7 & 2 ' Odd number of elements Problem 4 (40 Points) Even number elements Write a C++ program that takes as inputs from a teacher, the names of her/his students along with the grade of each student in an exam. Define a struct with two fields: Name and Grade. Create an array of this struct to store the students' data. All grades are integers that have to be in the range from 0 to 100 (inclusive). At the beginning, you will need to ask the teacher for the size of the class (the number of students) and use dynamic memory to create the array. The program will display (its outputs) the following: 1. The complete list of students along with their grades in a descending order of the grades. 2. The average and range of the students' grades. 3. The name of the student with the maximum grade and displays this grade. 4. The name of the student with the minimum grade and displays this grade. Each of the above four set of outputs must be implemented in a separate function where the array is passed to these functions as a parameter. Do not use any global variables in your program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
