1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
int main()
{
char name[MAX];
int assigns[ASSIGN_TOTAL], quizzes[QUIZ_TOTAL], exams[EXAMS_TOTAL], finalExam;
double assignsMedian, assignsMean, assignsPerc;
double quizzesMedian, quizzesMean, quizzesPerc;
double examsMedian, examsMean, examsPerc, finalPerc, classPerc, classGrade;
do
{
readName(name);
fillArray(assigns, ASSIGN_TOTAL, "assignments");
selectionSort(assigns, ASSIGN_TOTAL);
assignsMedian = findMedian(assigns, ASSIGN_TOTAL);
assignsMean = findMean(assigns, ASSIGN_TOTAL);
assignsPerc = calcPercentage(assigns, ASSIGN_TOTAL, ASSIGN_MAX);
fillArray(quizzes, QUIZ_TOTAL, "quizzes");
selectionSort(quizzes, QUIZ_TOTAL);
quizzesMedian = findMedian(quizzes, QUIZ_TOTAL);
quizzesMean = findMean(quizzes, QUIZ_TOTAL);
quizzesPerc = calcPercentage(quizzes, QUIZ_TOTAL, QUIZ_MAX);
fillArray(exams, EXAMS_TOTAL, "exams");
selectionSort(exams, EXAMS_TOTAL);
examsMedian = findMedian(exams, EXAMS_TOTAL);
examsMean = findMean(exams, EXAMS_TOTAL);
examsPerc = calcPercentage(exams, EXAMS_TOTAL, EXAMS_MAX);
finalExam = readFinalScore();
finalPerc = calcfinalPercentage(finalExam, FINAL_MAX);
classPerc = calcClassPerc(assignsPerc, quizzesPerc, examsPerc, finalPerc);
classGrade = calcGrade(assignsPerc, quizzesPerc, examsPerc, finalPerc);
displayResults(name, classPerc, classGrade,
assignsPerc, quizzesPerc, examsPerc, finalPerc,
assignsMean, quizzesMean, examsMean,
assignsMedian, quizzesMedian, examsMedian);
}while(goAgain());
return 0;
}
|