[solved]-Write C Program Reads Lab Scores Homework Scores Quiz Scores Exam Scores Produces Weighted Q39024987
Write a C program that reads in Lab scores, Homework scores,Quiz scores and Exam scores and then produces a weighted average.The weighted average will be based on what percent each of thestated categories. When the percentages of each category are added,they total 100%. All scores will be given on a 0 to 100 pointbasis.
Presume the following about each category:
Homeworks:
– 30% of the course grade
Labs:
– 20% of the course grade
Quizzes:
– 11% of the course grade
Exams:
– 39% of the course grade
Sample input (parenthesis denote the type):
Mark Stin 89 95 85 75 85 90 95 55 90 (Labs) 90 85 88 100 30(Homework) 99 100 98 76 80 85 (Quizzes) 56 85 95 (Exams)
You may presume all points for labs, homework, quizzes andexams will be positive.
You must ensure the totals for each category is greater than0.
The name may contain spaces. MAX is set to 100 – You mustuse this in your code TOTAL is set to 10 – You must use this inyour code
You must ensure all values are in range meaning the user can’tenter a number for the type that is less than 0 or greater thanTOTAL. You must ensure the scores are between 0 and 100inclusive.
Once the array has been filled, report the percentage earnedin each category followed by the weighted percentage – after 2decimal points the value will be rounded up.
Report the Grade Point for the course based on the followingformula:
4.2 – (( 100 – Avg. Percentile Score) / 12)
No grade is ever rounded up
Modified Sample Run removed all the user inputprompts
Student Name: Mark stin
89 95 85 75 85 90 95 55 90 (These were the entered values displayedthis way for space) Lab Average – LL.L.3%
90 85 88 100 30 (These were the entered values displayed this wayfor space) Homework Average – HH.H%
99 100 98 76 80 85 (These were the entered values displayed thisway for space) Quiz Average – QQ.Q%
56 85 95 (These were the entered values displayed this way forspace) Exam Average – EE.E%
Your weighted percentage is: XX.X%
Your final grade is: Y.Y
Specifics:
cLab8.c will contains my main() you may not change main Youmust use static arrays You must use stdin – All scores will beentered on the keyboard All input scores will be integer values You must have a file named lab8.h (with header guards) andlab8.c
need lab8.c and lab8.h files. You will find mainbelow:
————————————————————————————–
#include
#include
#include
#include “lab8.h”
const double LABP = .2, HWP = .3, QUIZP = .11, EXAMP =.39;
const int TOTAL = 10;
int main()
{
char name[MAX];
int hwTotal, quizTotal, labsTotal, examsTotal;
int hw[TOTAL], quizzes[TOTAL], labs[TOTAL], exams[TOTAL];
double labAvg, hwAvg, quizAvg, examAvg, weightedAvg,finalGrade;
readName(name);
labsTotal = readTotals(“Labs”);
fillArray(“Labs”, labs, labsTotal);
labAvg = calcAvg(labs,labsTotal);
displayAverage(“Lab”, labAvg);
hwTotal = readTotals(“Homeworks”);
fillArray(“Homeworks”, hw, hwTotal);
hwAvg = calcAvg(hw,hwTotal);
displayAverage(“Homework”, hwAvg);
quizTotal = readTotals(“Quizzes”);
fillArray(“Quizzes”, quizzes, quizTotal);
quizAvg = calcAvg(quizzes, quizTotal);
displayAverage(“Quiz”, quizAvg);
examsTotal = readTotals(“Exams”);
fillArray(“Exams”, exams, examsTotal);
examAvg = calcAvg(exams,examsTotal);
displayAverage(“Exam”, examAvg);
weightedAvg = calcWeighted(labAvg, LABP, hwAvg, HWP, quizAvg,QUIZP, examAvg, EXAMP);
finalGrade = calcGrade(weightedAvg);
display(weightedAvg, finalGrade);
return 0;
}// end main
Expert Answer
Answer to Write a C program that reads in Lab scores, Homework scores, Quiz scores and Exam scores and then produces a weighted av… . . .
OR

