Write a grading program for a class with the following gradingpolicies: 1. There
ID: 3613673 • Letter: W
Question
Write a grading program for a class with the following gradingpolicies:
1. There are two quizzes, eachgraded on the basis of 10 points.
2. There is one midterm exam andone final exam, each graded on the basis
of 100 points.
3. The final exam counts for 50%of the grade, the midterm counts for 25%,
and the two quizzestogether count for a total of 25%. (Do not forget to
normalize the quizscores. They should be converted to percent before they
are averaged in.)
Any grade of 90 or more is an A, any grade of80 or more (but less than 90)
is a B, any grade of 70 or more (but less than80) is a C, any grade of 60
or more (but less than 70) is a D, and anygrade below 60 is an F. The
program will read in the student's scores andoutput the student's record,
which consists of two quiz and two exam scoresas well as the student's
average numeric score for the entire courseand the final letter grade.
Define and use a structure for the studentrecord.
Explanation / Answer
Dear... #include<stdio.h>#include <ctype.h>
#include <stdlib.h>
#define NAME_LEN 50
#define STUD_LEN 3
void display(void);
int num_students = 0;
struct test_result
{
charname[NAME_LEN+1];
intnumber;
intgrade1;
intgrade2;
intmidterm;
intfinal;
floatnumeric;
}
studen[STUD_LEN];
int main(void)
{
charcode;
structtest_result test;
do
{
if(num_students== STUD_LEN) {
printf("Nomore students allowed. ");
break;
}
printf("Enter the student'sname: ");
scanf("%s",&test.name);
printf("Enter the student'sgrade for quiz #1: ");
scanf("%d",&test.grade1);
printf("Enter the student'sgrade for quiz #2: ");
scanf("%d",&test.grade2);
printf("Enter the student'sgrade for midterm: ");
scanf("%d",&test.midterm);
printf("Enter the student'sgrade for final: ");
scanf("%d",&test.final);
test.numeric = (((test.grade1 +test.grade2) * 1.25) + (test.midterm * 0.25) + (test.final *0.50));
printf("%s's numeric score forthe entire course is %.1f ", test.name, test.numeric);
studen[num_students++] =test;
printf(" ");
printf(" Enter another studentrecord? y(yes) or n(no)?");
scanf(" %c", &code);
}
while(code != 'n');
display();
system("pause");
return 1;
}
void display()
{
int i;
for(i = 0; i< num_students; i++)
{
printf("Studentname is %s ", studen[i].name);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.