Home /
Expert Answers /
Computer Science /
write-in-cpp-code-please-write-a-c-program-that-takes-as-inputs-from-a-teacher-the-names-of-her-pa592
(Solved): Write in cpp code please
Write a C++ program that takes as inputs from a teacher, the names of her/ ...
Write in cpp code please
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. In your program, the main function creates 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). Assume no two grades have the same value and there are at least six students in the class. At the beginning, you will need to ask the teacher for the size of the class (the number of students) and use dynamic memory allocation to create the array. The program will display (as its outputs) the following: 1. The average and median of the students' grades. 2. The name and grade of the three students with the maximum three grades. 3. The name and grade of the three students with the minimum three grades. Each one of the above four 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.