Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Please help me~!! i dunno do #3210
    nitesh1311
    Participant
    #include 
    #include
    DEFINE CLASS_SIZE 4
    void main()
    {
    /*Local Declaration*/
    char gradeAACS1084[CLASS_SIZE],gradeAACS1123[CLASS_SIZE];
    float scoreAACS1084[CLASS_SIZE],scoreAACS1123[CLASS_SIZE] ;
    float solutionGPA[CLASS_SIZE],totalsolutionGPA=0.000;
    float lowestGPA=4.000,highestGPA=0.000;
    int highGPAstudent,lowGPAstudent;
    /*============================== get input grade ==============================*/
    for(a=1;a<=CLASS_SIZE;a++){
    printf("Please Input the score for >n");
    for(a=1;a<=CLASS_SIZE;a++){
    printf("nStudent %dnn",a);
    printf("AACS1084( Programming Concepts & Design II ): ");
    scanf("%c",&gradeAACS1084[a]);
    printf("nn");
    printf("AACS1123( Principles of Information Systems ): ");
    scanf("%c",&gradeAACS1123[a]);
    printf("nn");
    }//Get Grade
    /*============================== Convert PCD2 Score ==============================*/
    for(a=1;a<=CLASS_SIZE;a++){
    if(toupper(gradeAACS1084[a])=='A')
    scoreAACS1084[CLASS_SIZE]=4.000;
    else if(toupper(gradeAACS1084[a])=='B')
    scoreAACS1084[CLASS_SIZE]=3.000;
    else if(toupper(gradeAACS1084[a])=='C')

    scoreAACS1084[CLASS_SIZE]=2.000;
    else if(toupper(gradeAACS1084[a])=='D')

    scoreAACS1084[CLASS_SIZE]=1.000;
    else if(toupper(gradeAACS1084[a])=='E')

    scoreAACS1084[CLASS_SIZE]=0.000;
    else if(toupper(gradeAACS1084[a])=='F')

    scoreAACS1084[CLASS_SIZE]=0.000;
    /*============================== Convert PIS Score ==============================*/
    if(toupper(gradeAACS1123[a])=='A')

    scoreAACS1123[CLASS_SIZE]=4.000;
    else if(toupper(gradeAACS1123[a])=='B')

    scoreAACS1084[CLASS_SIZE]=3.000;
    else if(toupper(gradeAACS1123[a])=='C')

    scoreAACS1123[CLASS_SIZE]=2.000;
    else if(toupper(gradeAACS1123[a])=='D')

    scoreAACS1123[CLASS_SIZE]=1.000;
    else if(toupper(gradeAACS1123[a])=='E')

    scoreAACS1123[CLASS_SIZE]=0.000;
    else if(toupper(gradeAACS1123[a])=='F')

    scoreAACS1123[CLASS_SIZE]=0.000;

    /*============================== Calculate GPA ==============================*/
    solutionGPA[CLASS_SIZE]=(scoreAACS1084[CLASS_SIZE]+scoreAACS1123[CLASS_SIZE]/(3.000+4.000);

    totalsolutionGPA+=solutionGPA[CLASS_SIZE];

    if(solutionGPA[CLASS_SIZE]<lowestGPA){
    lowestGPA=solutionGPA[CLASS_SIZE];
    lowGPAstudent=a;
    }//determine lowest GPA student

    if(solutionGPA[CLASS_SIZE]>highestGPA){
    highestGPA=solutionGPA[CLASS_SIZE];
    highGPAstudent=a;
    }//determine highest GPA student
    }//end for loop(from get input grade)
    //Calculate average total GPA
    averagetotalGPA=totalsoltionGPA/CLASS_SIZE;
    /*============================== Display output ==============================*/
    printf("nttExamination Resultn");
    printf("Student No.tAACS1084ttAACS1123ttGrade Point Averagen");
    printf("===========t========tt========tt=== ================n");

    for(a=1;a<=CLASS_SIZE;a++){
    printf("%dtt%ctt%ctt%ct%ctt%.3fn",a,gr adeAACS1084[a],gradeAACS1123[a],solutionGPA[CLASS_SIZE]);
    }

    printf("nnAVERAGE GPA = %dn",averagetotalGPA);
    printf("nnHIGHEST GPA = %.3ft obtained by Student No. %d",);
    printf("nnLOWEST GPA = %.3ft obtained by Student No. %d",lowestGPA,lowGPAstudent);

Viewing 1 post (of 1 total)