Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a program that reads a student\'s name together with his or her test score

ID: 3620093 • Letter: W

Question


write a program that reads a student's name together with his or her test scores. The program schould then compute theaverage test score for each student and assign the appropriategrade. The grade scale is as follows 90-100, A; 80-89, B;70-79, C; 60-69, D; F, your program must use the followingfunctions;
(a) A void function, calculateAverage, to determine theaverage of the five test scores for each students. Use a loopto read and sum the five test scores. (This functions doesnot output the average test score. That task must be done inthe function main)
(b) A value-returning, calculateGrage, to determine and returneach student's grade.(This function does not output the grade thattask must be done in the function main)
this is the infile
Johnson 85 83 77 91 76
Aniston 80 90 95 93 48
Cooper 78 81 11 90 73
Gupta 92 83 30 69 87
Blair 23 45 96 38 59
Clark 60 85 45 39 67
Kennedy 77 31 52 74 83
Bronson 93 94 89 77 97
Sunny 79 85 28 93 82
Smith 85 72 49 75 63
Sample output:
The output should be of the following form: (fill the last 2columns and the last line showing the class average.)
Student Test1 Test2 Test3 Test4 Test5 Average Grade
Johnson 85 83 77 91 76
Aniston 80 90 95 93 48
Cooper 78 81 11 90 73
Gupta 92 83 30 69 87
Blair 23 45 96 38 59
Clark 60 85 45 39 67
Kennedy 77 31 52 74 83
Bronson 93 94 89 77 97
Sunny 79 85 28 93 82
Smith 85 72 49 75 63
Class Average =

you also need to ad a readFile Function
and PrintGradeSheet functions

I also need to put in arrays
ill set up the question after you are done

I already started on the code

Im having a lot of problems with functions

#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
void readFile(ifstream&);
char calculateGrade(double);
void calculateAverage(ifstream&,int[],double&[]);
int main(void)
{
string name ;
int i,grade[5];
string Name[10];
int Test[10][5];
double average[10];
char letter;
ifstream infile;
ofstream outfile;
infile.open("project2numbers.txt");
outfile.open("testavg.txt");

outfile<<"Student"<<" "<<"Test1"<<" "<<"Test2"<<" "<<"Test3"<<" "<<"Test4"<<" "<<"Test5"<<" "<<"Average"<<" "<<"Grade";

while(infile)
{
calculateAverage(infile,Test,average);
letter= calculateGrade(average);
outfile<<name<<" ";
for(i=0;i<numgrades;i++)
outfile<<grade[i]<<" ";
outfile<<average<<" "<<letter<<" ";
infile>>name;
}


pls help

Explanation / Answer

Dear... #include #include struct stud { char name[20]; int m[5]; float avg; float total; char grade; }; struct stud s[100]; int reclen = sizeof(struct stud); void getinfo(struct stud s[] , int n); char calcgrade( struct stud x); FILE* fp1 , *fp2; void main() { int n , i , j ; struct stud p; fp1 = fopen("STUDI.TXT" , "w"); if(!fp1) { printf("Error : Unable to open input file"); return; } printf("Enter how many students :"); scanf("%d" , &n); printf("Enter the students detail : "); getinfo( s , n); fseek(fp1 , 0 , SEEK_END); /* Seek to end of file */ for( i = 0 ; i