Question: Please help me with this. Write a program that will solve the following: A teacher has five students who have taken four Exams. The teacher
Please help me with this.
Write a program that will solve the following:
A teacher has five students who have taken four Exams. The teacher uses the following grading scale to assign a letter grade to each student, based on the average of the four exams:
A
B
C
D
F
This program uses several parallel arrays. There is an array of strings to hold the student names and arrays of elements each doubles one entry per student in each array at the common index review the material in the Powerpoint for the class for ch section slides to hold the exam scores for each student. The student names and exam scores will be read from a file called Grading.txt You will incorporate the code for doing this into its own function called GetData with appropriate parameters that will be called from main once for each of the students for which name and exam data are needed.
The format of the Grading.txt file will be as follows:
firstName lastName
examValue
examValue
examValue
examValue
and there will be a block of lines of data like this for each of the students.
Other arrays you will need include an array of characters to hold the students letter grades and an array of doubles to hold the student averages round up if or above, down if or less
One all the entries have been made from the input file Grading.txt using the newly created function GetData you will need a function called CalcAvg with appropriate parameters based on each students set of exam grades in that array. You should also determine the letter grade in this function.
Finally, you will need a function to display the name of each student, along with their average and letter grade to the screen, DisplayData with appropriate parameters.
Structure of program:
your main should just essentially initialize variables as needed and call other functions
the input of data from the text file into the arrays should be handled in one function, GetData with appropriate parameters
the calculation of the average for each student and their assignment of letter grade should be handled in one function, CalcAvg with appropriate parameters
the display of the output should be done in another function, DisplayData with appropriate parameters
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
