Write a C++ program to calculate students’ average test scores and their grades.
ID: 3759644 • Letter: W
Question
Write a C++ program to calculate students’ average test scores and their grades. Your program must use three arrays, sized to handle 50 students with five scores each: • a one-dimensional array to store the students’ names, • a parallel two-dimensional array to store the test scores, and • a parallel one-dimensional array to store grades. Your program must contain at least the following functions: • A function to read and store data into two arrays, • A function to calculate the average test score and grade, and • A function to output the results. Each line in input file will consist of a student name, followed by five integer scores, followed by a newline character. A space character separates each field. While the input file is guaranteed to be well formed (i.e. no missing data), there is no assurance how many students may be listed in the file. The file may be empty, or it may have more than fifty students. Code to the specification, not the sample input file.
If the input file is empty, your program should not print anything. Set the exit code appropriately
please use your code array. thank you
Explanation / Answer
#include #include using namespace std; int main() { //step 1: Declare variables string firstname = " "; float avg=0, grade1=0, grade2=0, grade3=0; char finalGrade = 'F'; int studentCount=0; double Average = (grade1+grade2+grade3)/3; int 90-100=A, 80-89.9=B, 70-79.9=C, 60-69.9=D, 0-59.9=F; //step 2: Design the loop to process students for(int studentCount=1; studentCountRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.