Question: Having trouble with my code; #include #define MAX _ STUDENTS 5 0 int main ( ) { int numStudents, id [ MAX _ STUDENTS ]
Having trouble with my code; #include
#define MAXSTUDENTS
int main
int numStudents, idMAXSTUDENTS;
float midtermMAXSTUDENTS final MAXSTUDENTS weightedAvgMAXSTUDENTS deviationMAXSTUDENTS totalWeightAvg avgWeightedAvg;
Get the number of students from the teacher
printfEnter the number of students in the class max : ;
scanfd &numStudents;
Input student data
for i ; i numStudents; i
printf
Enter details for Student d:
i ;
printfID: ;
scanfd &idi;
printfMidterm Grade: ;
scanff &midtermi;
printfFinal Grade: ;
scanff &finali;
Calculate weighted average for each student
weightedAvgi midtermi finali;
totalWeightedAvg weightedAvgi;
Calculate average of all weighted averages
avgWeightedAvg totalWeightedAvg numStudents;
Calculate deviation for each student
for int i ; i numStudents; i
deviationi weightedAvgi avgWeightedAvg;
Display results in a table
printf
Class Average Weighted Average: f
avgWeightedAvg;
printf
;
printf IDt Midtermt Finalt Weighted Avgt Deviationt
;
printf
;
for int i ; i numStudents; i
printfdtftftfttftt
idi midtermi finali weightedAvgi deviationi;
printf
;
return ;
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
