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...

1 answer below »

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:




  1. 90-100, A




  2. 80-89, B




  3. 70-79, C




  4. 60-69, D




  5. 0-59, F




This program uses several parallel arrays. There is an array of strings to hold the 5 student names and 5 arrays of four elements each (doubles), one per student, 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 5 students for which name and exam data are needed.


The format of the Gradebook.txt file will be as follows:


firstName lastName


examValue1


examValue2


examValue3


examValue4


and there will be a block of 5 lines of data like this for each of the 5 students.



Other arrays you will need include an array of characters to hold the 5 students letter grades and an array of 5 doubles to hold the 5 student averages (round up if .5 or above, down if .49 or less).



One all the entries have been made from the input file Gradebook.txt using the newly created function getData(), you will need a function called calcAvg(), with appropriate parameters based on each student's 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:


1) your main() should just essentially initialize variables as needed and call other functions


2) the input of data from the text file into the arrays should be handled in one function, getData(), with appropriate parameters


3) the calculation of the average for each student and their assignment of letter grade should be handled in one function, calcAvg(), with appropriate parameters


4) the display of the output should be done in another function, displayData (), with appropriate parameters



Answered 372 days AfterApr 03, 2021

Answer To: Write a program that will solve the following: A teacher has five students who have taken four...

Vibhav answered on Apr 10 2022
106 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here