Pages

Friday, 30 August 2013

Simple Grading System Using Turbo-C or C-Language

This Project is develop using Turbo-C, the project compute the semester grade of student  it can identify if the student is Failed or Passed. The coding of said project is using of different programming operators and logical statement like (IF-Else Statement), (Do-While Loop) and etc.


Project Specification
Programming Language Use: Turbo-C
Version: Any Version: Any Version of Turbo-C Console

Here is the Code:

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main()
{
clrscr();
char stnum,lname,fname,mname,chc;
float q1,q2,psa,exam;
float q_eq,psa_eq,exam_eq;
float q_percent,psa_percent,exam_percent,lec_grade,lab_grade,sem_grade;
int x=5;
start:
clrscr();
gotoxy(x+20,2);    printf("ACLC COLLEGE");
gotoxy(x+24,3);    printf("GENSAN");
gotoxy(x+20,4);    printf("PERIODIC SHEET");

gotoxy(x,8);    printf("Student Number:");
gotoxy(x,10);    printf("Last Name:");
gotoxy(x,12);    printf("Midle Initial:");
gotoxy(x,14);    printf("First Name:");

    /*for Prelim-Lecture*/
gotoxy(x,16);    printf("_________________________________");
gotoxy(x,18);    printf("Prelim (Lecture)");
gotoxy(x+3,20);    printf("Quiz1 (Over 20):");
gotoxy(x+3,22);    printf("Quiz2 (Over 20):");
gotoxy(x+3,24);    printf("PSA (Over 100)  :");
gotoxy(x+30,22);    printf("Quiz Equivalent:");    gotoxy(x+55,22);    printf("Percentage:");
gotoxy(x+30,24);    printf("PSA Equivalent :");     gotoxy(x+55,24);    printf("Percentage:");
gotoxy(x+3,26);        printf("Exam (Over 50):");
gotoxy(x+30,26);    printf("Exam Equivalent:");    gotoxy(x+55,26);    printf("Percentage:");
gotoxy(x,28);        printf("Lecture Grade(60%):");
       /*for Prelim-Laboratory*/
gotoxy(x,29);    printf("_________________________________");
gotoxy(x,31);    printf("Prelim (Laboratory)");

gotoxy(x+3,33);    printf("Quiz1 (Over 20):");
gotoxy(x+3,35);    printf("Quiz2 (Over 20):");
gotoxy(x+3,37);    printf("PSA (Over 100) :");
gotoxy(x+30,35);    printf("Quiz Equivalent:");    gotoxy(x+55,35);    printf("Percentage:");
gotoxy(x+30,37);    printf("PSA Equivalent :");     gotoxy(x+55,37);    printf("Percentage:");
gotoxy(x+3,39);        printf("Exam (Over 50):");
gotoxy(x+30,39);    printf("Exam Equivalent:");    gotoxy(x+55,39);    printf("Percentage:");
gotoxy(x,41);    printf("Laboraoty Grade(40%):");
gotoxy(x,42);        printf("_________________________________");
gotoxy(x+3,45);        printf("Prelim Grade:");    gotoxy(x+30,45);    printf("Remarks:");
gotoxy(x,47);         printf("Try Again[Y/N]:");

    /* for scanf*/

gotoxy(x+20,8);        scanf("%s",&stnum);
gotoxy(x+20,10);    scanf("%s",&lname);
gotoxy(x+20,12);    scanf("%s",&mname);
gotoxy(x+20,14);    scanf("%s",&fname);

        /*for Lecture*/
gotoxy(x+20,20);        scanf("%f",&q1);
gotoxy(x+20,22);        scanf("%f",&q2);

     q_eq=(q1+q2)/40*50+50;     gotoxy(x+47,22);      printf("%.2f",q_eq);
     q_percent=(q_eq*.4);        gotoxy(x+67,22);      printf("%.2f",q_percent);

gotoxy(x+20,24);        scanf("%f",&psa);
psa_eq=((psa/100)*50+50);     gotoxy(x+47,24);      printf("%.2f",psa_eq);
 psa_percent=(psa_eq*.1);        gotoxy(x+67,24);      printf("%.2f",psa_percent);

gotoxy(x+20,26);        scanf("%f",&exam);
exam_eq=((exam/50)*50+50);     gotoxy(x+47,26);      printf("%.2f",exam_eq);
 exam_percent=(exam_eq*.5);        gotoxy(x+67,26);      printf("%.2f",exam_percent);

lec_grade=(q_percent+psa_percent+exam_percent)*.6;        gotoxy(x+20,28);    printf("%.0f%",lec_grade);

    /*for lab*/
gotoxy(x+20,33);        scanf("%f",&q1);
gotoxy(x+20,35);        scanf("%f",&q2);

     q_eq=(q1+q2)/40*50+50;     gotoxy(x+47,35);      printf("%.2f",q_eq);
     q_percent=(q_eq*.4);        gotoxy(x+67,35);      printf("%.2f",q_percent);

gotoxy(x+20,37);        scanf("%f",&psa);
psa_eq=((psa/100)*50+50);     gotoxy(x+47,37);      printf("%.2f",psa_eq);
 psa_percent=(psa_eq*.1);        gotoxy(x+67,37);      printf("%.2f",psa_percent);

gotoxy(x+20,39);        scanf("%f",&exam);
exam_eq=((exam/50)*50+50);     gotoxy(x+47,39);      printf("%.2f",exam_eq);
 exam_percent=(exam_eq*.5);        gotoxy(x+67,39);      printf("%.2f",exam_percent);

lab_grade=(q_percent+psa_percent+exam_percent)*.4;        gotoxy(x+22,41);     printf("%.2f",lab_grade);

sem_grade=lec_grade+lab_grade;        gotoxy(x+17,45);     printf("%.0f%",sem_grade);

if (sem_grade>=75)
{gotoxy(x+38,45);    printf("Passed");}

 else if(sem_grade<=74)
{gotoxy(x+38,45);       printf("Failed");}

gotoxy(x+16,47);
 scanf("%s",&chc);

if (chc=='Y'|| chc=='y')
goto start;
else
{return 0;}

getch();

return 0;
}

No comments:

Post a Comment