Question: help in c++ In this program you are going to save the names of 5 students and their course grades in parallel arrays. Your program
help in c++
In this program you are going to save the names of 5 students and their course grades in parallel arrays. Your program should output the contents of both arrays, find the student with the highest score, and output the student name with the highest score along with his/her score. - Create an array of strings of size 5 called studentName [] and a parallel array of integers called studentGrade []. - Initialize studentName [] with an initialization list using the following names: Amanda Baynes, Victor Hughes, Scott Collins, Lori Macbeth, and Manny Lopez (see Pr7-4.cpp for an example) - Read in the the grade of each student into the studentGrade [] array (see Pr7-15.cpp for an example). - In a for loop, print the name of each student left justified in a field width of 15 , along with his/her grade right justified in a field width of 3. - Determine the highest score achieved by a student. Display the student's name and the score. Also display the index of the student who made the highest score. I will be grading this lab with a script. If you do not use parallel arrays and do not find and use the index of the person with the highest score, you will NOT receive credit. I will change your grade in Blackboard to reflect this. Hints: - Check slide 3 of CS1336_Lect7c_Arrays_Compare_Parallel.pptx for the code to find the highest. - To display the name of the student who achieved the highest score, you will have to keep track of the index at which you found the highest grade. Output the student name corresponding to the index. For example, if studentGrade [2] is the highest grade, you will output studentName [2] as the corresponding student name. Sample studentName array declaration and example of how it appears in memory: string studentName[] = \{"Amanda Baynes", "Victor Hughes", "Scott Collins", "Lori Macbeth", "Manny Lopez"\}; When the input is as shown in Figure 1, your program should produce the output as shown in Figure 2. Figure 1: (sample input)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
