Question:
Swinburne Sarawak Grading Scheme:
Student mark (0-100) Corresponding grade
85 – 100 “H”
75 – 84 “D”
65 – 74 “C”
50 – 64 “P”
0 – 49 “N” (4 points) Draw a flowchart to:
· get one student’s mark · decide and display which grade the mark is in ( make a series of if / else decisions) - 1 pt · add 1 (one) to the corresponding counter for grade HD and grade N
· ask if this is the last student · if not the last student, return to the start to get the next student’s mark
· if no more student, find if the number of students who score H is bigger than the number of students who score N
o if yes, print “Good Result” o else, print “Poor Result’ mY ANSWER NEDDS EDITING and has some error please correct:
Code:
#include<stdio.h>
int main()
{
float mark;
int hd=0;
int l=0;
char decision;
do{
printf("Enter mark of student:");
scanf("%f",&mark);
if(mark<=100 && mark>=85)
{
printf("H\n");
}
if(mark<=84 && mark>=75)
{
printf("D\n");
}
if(mark<=74 && mark>=65)
{
printf("C\n");
}
if(mark<=64 && mark>=50)
{
printf("P\n");
}
if(mark<=49 && mark>= 0)
{
printf("N\n");
}
if(mark<=100 && mark>=85)
{
hd=0;
l=hd+l;
l++;
}
printf("Is this the last student?\n");
scanf("%ch",&decision);
}while(decision!='y');
if(hd>l)
{
printf("Good Result");
}
else
{
printf("Poor Result");
}
}