Grading system for Primary school using C language


Hello guys the following are the codes for grading system . There is no database but the system loops up to 10 people or students. This code will help computer beginers using Borland C languague. thanks
========================================================================

#include<stdio.h>
main()
{
char name[40];
char cl [12];
int math;
int sst;
int eng;
int sci;
int total;
int average;
int e;
for(e=0;e<=10;e++)
{
printf("     WELCOME TO LUCKYCODERS PRIMARY SCHOOL           \n");
printf(" \t  the solution for world problems. \n");
printf("     .....................................................\n");
printf("              ..........................            \n");
printf("    STUDENT GRADING SYSTEM OF THE SCHOOL\n");
printf("                 \n");
printf("     STUDENT NAME  ");
scanf("%s",&name);
printf("                                     \n");
printf("     STUDENT CLASS     ");
scanf("%s",&cl);
printf("                                     \n");
printf("        MATH =    ");
scanf("%d",&math);
if(math>=85)
printf("                    D1                  \n");
else if(math>=75)
printf("                    D2                  \n");
else if(math>=60)
printf("                    C3                  \n");
else if(math>=55)
printf("                    C4                  \n");
else if(math>=50)
printf("                    C5                  \n");
else if(math>=45)
printf("                    P6                  \n");
else if(math>=40)
printf("                    P7                  \n");
else if(math>=35)
printf("                    P8                  \n");
else
printf("                    F9                  \n");
printf("                                     \n");
printf("        ENG =     ");
scanf("%d",&eng);
if(eng>=85)
printf("                    D1                  \n");
else if(eng>=75)
printf("                    D2                  \n");
else if(eng>=60)
printf("                    C3                  \n");
else if(eng>=55)
printf("                    C4                  \n");
else if(eng>=50)
printf("                    C5                  \n");
else if(eng>=45)
printf("                    P6                  \n");
else if(eng>=40)
printf("                    P7                  \n");
else if(eng>=35)
printf("                    P8                  \n");
else
printf("                    F9                  \n");
printf("                                     \n");
printf("                                     \n");
printf("        SST =     ");
scanf("%d",&sst);
if(sst>=85)
printf("                    D1                  \n");
else if(sst>=75)
printf("                    D2                  \n");
else if(sst>=60)
printf("                    C3                  \n");
else if(sst>=55)
printf("                    C4                  \n");
else if(sst>=50)
printf("                    C5                  \n");
else if(sst>=45)
printf("                    P6                  \n");
else if(sst>=40)
printf("                    P7                  \n");
else if(sst>=35)
printf("                    P8                  \n");
else
printf("                    F9                  \n");
printf("                                     \n");
printf("                                     \n");
printf("        SCIENCE =  ");
scanf("%d",&sci);
if(sci>=85)
printf("                    D1                  \n");
else if(sci>=75)
printf("                    D2                  \n");
else if(sci>=60)
printf("                    C3                  \n");
else if(sci>=55)
printf("                    C4                  \n");
else if(sci>=50)
printf("                    C5                  \n");
else if(sci>=45)
printf("                    P6                  \n");
else if(sci>=40)
printf("                    P7                  \n");
else if(sci>=35)
printf("                    P8                  \n");
else
printf("                    F9                  \n");
printf("                                     \n");
total=math+eng+sst+sci;
if (total>=300)
printf(" GRADE    =   DIVISION ONE    \n");
else if(total>=200)
printf(" GRADE   =     DIVISION TWO  \n");
else if(total>=150)
printf(" GRADE   =        DIVISION THREE \n");
else if(total>=100)
printf(" GRADE   =    DIVISION FOUR     \n");
else
printf(" GRADE   =        FALIURE  \n");
printf("                            \n");
printf(" TOTAL   =        %d\n",total);
printf("                   \n");
average=total/4;
printf(" AVERAGE MARK IS =  %d\n",average);
printf("                                   \n");
if(average>=50)
printf("  ****YOU HAVE PASSED***   \n");
else
printf("  ****YOU HAVE FAILED****\n");
printf("                             \n");
printf("          thanks\n");
printf("\n");
}
return 0;
}




Related Posts
Previous
« Prev Post

Contact Form

Name

Email *

Message *