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

Write a program to keeprecords and perform statistical analysis for a class of s

ID: 3618678 • Letter: W

Question

Write a program to keeprecords and perform statistical analysis for a class of students.the class may have up to 40 students
. there are five quizes during the term. Each student is identifiedby a four digit student number.
the program will print the student scores and calculate and printthe statistics for each quiz. the output is is in the same order asthe input
no sorting is needed. the input will be read from a text file. theoutput form the program should be similar to thefollowing.
student quiz1 quiz 2 quiz 3 quiz 4 quiz5 1234 78 83 87 91 86 2134 67 77 84 82 79 3124 77 89 93 87 71 high score 78 89 93 91 86 low score 67 77 84 82 71 Average 73.4 83 88.2 86.6 87.6 use one and two dimensional arrays only. Test your programwith these quiz data Student q1 q2 q3 q4 q5
 1234 52 7 100 78 342134 90 36 90 77 303124 100 45 20 90 704532 11 17 81 32 775678 20 12 45 78 346134 34 80 55 78 457874 60 100 56 78 458026 70 10 66 78 569893 34 9 77 78 561947 45 40 88 78 552877 55 50 99 78 773189 22 70 100 78 774602 89 50 91 78 605405 11 11 0 78 106999 0 98 89 78 20
Write a program to keeprecords and perform statistical analysis for a class of students.the class may have up to 40 students
. there are five quizes during the term. Each student is identifiedby a four digit student number.
the program will print the student scores and calculate and printthe statistics for each quiz. the output is is in the same order asthe input
no sorting is needed. the input will be read from a text file. theoutput form the program should be similar to thefollowing.
student quiz1 quiz 2 quiz 3 quiz 4 quiz5 1234 78 83 87 91 86 2134 67 77 84 82 79 3124 77 89 93 87 71 high score 78 89 93 91 86 low score 67 77 84 82 71 Average 73.4 83 88.2 86.6 87.6 use one and two dimensional arrays only. Test your programwith these quiz data Student q1 q2 q3 q4 q5
 1234 52 7 100 78 342134 90 36 90 77 303124 100 45 20 90 704532 11 17 81 32 775678 20 12 45 78 346134 34 80 55 78 457874 60 100 56 78 458026 70 10 66 78 569893 34 9 77 78 561947 45 40 88 78 552877 55 50 99 78 773189 22 70 100 78 774602 89 50 91 78 605405 11 11 0 78 106999 0 98 89 78 20
student quiz1 quiz 2 quiz 3 quiz 4 quiz5 1234 78 83 87 91 86 2134 67 77 84 82 79 3124 77 89 93 87 71 high score 78 89 93 91 86 low score 67 77 84 82 71 Average 73.4 83 88.2 86.6 87.6

Explanation / Answer

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

charfileName[100];
inttotalRecords=0;
structstudent
{
intSID;
intquiz[5];
}students[40],highscore,lowscore,avgscore;

voidloadDataFromFile()
{
FILE* filePointer;
intcounter = 0;
filePointer =fopen(fileName, "r");
if(filePointer != NULL)
{
//Loading eachrecord from the file into our array.
fscanf(filePointer,"%d",&totalRecords);
while(!feof(filePointer))
{
fscanf(filePointer, "%d%d %d %d %d %d" , &students[counter].SID,&students[counter].quiz[0], &students[counter].quiz[1],&students[counter].quiz[2], &students[counter].quiz[3],&students[counter].quiz[4]);
counter++;
}
clrscr();
printf(" Datasuccessfully loaded into the Arrays! ");
fclose(filePointer);
}
else
{
printf("Error: The fileyou specified could not be open in Read Mode !");
}
}

intgetHighScores(int quizNumber)
{
inthighScore = -1;
inti=0;
for(i=0;i<totalRecords;i++)
{
if(i==0)
{
highScore = students[i].quiz[quizNumber];
}
else
{
if(highScore <students[i].quiz[quizNumber])
highScore = students[i].quiz[quizNumber];
}
}

returnhighScore;
}

intgetLowScores(int quizNumber)
{
intlowScore = -1;
inti=0;
for(i=0;i<totalRecords;i++)
{
if(i==0)
{
lowScore = students[i].quiz[quizNumber];
}
else
{
if(lowScore >students[i].quiz[quizNumber])
lowScore = students[i].quiz[quizNumber];
}
}

returnlowScore;
}

intgetAvgScore(int quizNumber)
{
intavgScore = 0;
inti=0;
for(i=0;i<totalRecords;i++)
{
avgScore = avgScore + students[i].quiz[quizNumber];
}
avgScore = avgScore/totalRecords;
returnavgScore;
}

voidprint()
{
inti=0;
clrscr();
printf(" *****************Students QuizReport********************");
printf(" ---------------------------------------------------------");
printf(" Student Quiz1 Quiz2 Quiz3 Quiz4 Quiz5");
for(i=0;i<totalRecords;i++)
{
printf(" %d %d %d %d %d %d",students[i].SID,students[i].quiz[0],students[i].quiz[1],students[i].quiz[2],students[i].quiz[3],students[i].quiz[4]);
}
printf(" High Score %d %d %d %d %d",highscore.quiz[0],highscore.quiz[1],highscore.quiz[2],highscore.quiz[3],highscore.quiz[4]);
printf(" Low Score %d %d %d %d %d",lowscore.quiz[0],lowscore.quiz[1],lowscore.quiz[2],lowscore.quiz[3],lowscore.quiz[4]);
printf(" Avg Score %d %d %d %d %d",avgscore.quiz[0],avgscore.quiz[1],avgscore.quiz[2],avgscore.quiz[3],avgscore.quiz[4]);
printf(" ---------------------------------------------------------");

}

voidmain()
{
inti=0;
highscore.SID = 9999;
lowscore.SID = 9998;
avgscore.SID = 9997;
printf(" Please enterthe file name : ");
scanf("%s",&fileName);
loadDataFromFile();
for(i=0;i<5;i++)
{
highscore.quiz[i] = getHighScores(i);
lowscore.quiz[i] = getLowScores(i);
avgscore.quiz[i] = getAvgScore(i);
}
print();
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote