jara

11ove11beFri, 28 Nov 2008 03:24:32 +0000 28,2008

prelim exam

Filed under: Uncategorized - Administrator @ 3:24 am

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

int main(){
       char subject[]= "Cprog1:";
       char subject1[]= "CHST:";
       char subject2[]= "English2:";
       char subject3[]= "Math2:";
       char subject4[]= "Filipino2:";
       int id;
       float total[4];
       float pGrade[4];
       float mGrade[4];
       float fGrade[4];
       float ave[4];
       float sAve;
       float pAve,mAve,fAve;
    printf("CPROG 1 \nPRELIM PRACTICAL EXAM \nAY2007 - 2008\n\n");
    printf("\nEnter Your 3 digits ID number: ");
    scanf("%d",&id);
    printf("\nEnter Subjects taken / enrolled and their prelim , midterm and finals Grades.\n");
    printf("—————————————————————————–\n");
    printf("Subjects\t\tPrelim\t\tMidterm\t\tFinals\n");
    printf("—————————————————————————–\n");
    
    for(int x = 0;x<5;x++){
    if(x==0){
    printf("%s",subject);
    }
    if(x==1){
    printf("%s",subject1);
    }
    if(x==2){
    printf("%s",subject2);
    }
    if(x==3){
    printf("%s",subject3);
    }
    if(x==4){
    printf("%s",subject4);
    }
            scanf("%f",&pGrade[x]);
            scanf("%f",&mGrade[x]);
            scanf("%f",&fGrade[x]);
            total[x] = pGrade[x] + mGrade[x] + fGrade[x];
            ave[x] = total[x]/3;
            pAve += pGrade[x];
            mAve += mGrade[x];
            fAve += fGrade[x];
    }
    printf("\n");
    for(int x = 0;x<5;x++){
    if(x==0){
    printf("%s Average:",subject);
    }
    if(x==1){
    printf("%s Average:",subject1);
    }
    if(x==2){
    printf("%s Average:",subject2);
    }
    if(x==3){
    printf("%s Average:",subject3);
    }
    if(x==4){
    printf("%s Average:",subject4);
    }
    printf("%.2f \n",ave[x]);
    }
    float gP,gM,gF;
    gP = pAve/5;
    gM = mAve/5;
    gF = fAve/5;
    printf("\n\n\n\tPrelim Average: %.2f ",gP);
    printf("\n\tMidterm Average: %.2f ",gM);
    printf("\n\tFinal Average: %.2f ",gF);
    sAve = (gP + gM+ gF)/3;
    printf("\n\tSemester Average: %.2f\n ",sAve);
    
    printf("\n—————————————————————————–\nSUMMARY:\n");
    printf("Your Semester Average is %.2f and your ID number is %d.\n ",sAve,id);
    printf("\n—————————————————————————–\nFinal Decision:\n");
    if(sAve < 75 )
            printf("Failed, not qualified for the course!\n");
    else
            printf("You can now proceed to the next level!\n");
    if(sAve >= 75 && sAve <80)
    printf(" %.2fPassed, probationary status!" , sAve);
    if(sAve >= 80 && sAve <85)
    printf(" %.2fPassed, regular student!", sAve);
    if(sAve >= 85 && sAve < 90)
    printf(" %.2fThird Honor, Congratulations!", sAve);
    if(sAve == 90 && sAve <95)
    printf(" %.2fSecond Honor, Congratulations!", sAve);
    if(sAve == 95 && sAve <100)
    printf(" %.2fFirst Honor, Congratulations!", sAve);
    if(sAve==100)
    printf(" %.2fPerfect, Excellent!");
    printf("\n—————————————————————————–");
    printf("\n-End Of Program-");

    
    getch();
}

Comments »

The URI to TrackBack this entry is: http://jarah.blogsome.com/2008/11/28/prelim-exam/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph