1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

moderation code

Discussion in 'C' started by ciali, Aug 28, 2010.

  1. ciali

    ciali New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    2. A student studying Information Technology at Polytechnic of Namibia is examined by coursework and written examination. Both components of assessment carry a maximum of 50 marks. The following rules are used by examiners in order to pass or fail students.
    a. A student must score a total of 40% or more in order to pass
    (total = coursework marks + examination marks)
    b. A total mark of 39% is moderated to 40%
    c. Each component must be passed with a minimum mark of 20/50. If a student scores a total of 40% or more but does not achieve the minimum mark in either component he/she is given a technical fail of 39% (this mark is not moderated to 40%)
    d. Grades are awarded on marks that fall into the following categories.

    Mark 100-70 69-60 59-50 49-40 39-0
    Grade A B C D E

    Write a program to input the marks for both components (coursework marks out of 50 and examination marks out of 50), out put the final mark and grade after any moderation.


    help,the following is what i came up with:


    #include
    void main(void)
    {
    float c_mark,x_mark,t_mark;

    printf("enter the course mark \n");
    scanf("%f",&c_mark);
    c_mark=c_mark/50*100;

    printf("enter the exam mark \n");
    scanf("%f",&x_mark);
    x_mark=x_mark/50*100;

    t_mark= c_mark + x_mark;

    if(t_mark = 39)
    {
    t_mark = t_mark + 1;
    }


    if((c_mark>=40)&&(x_mark>=40))
    {
    printf("passed component");
    }
    else
    {
    printf("failed component");
    }

    if((t_mark=70))
    {
    printf("the grade is A \n");

    }
    else
    if((t_mark=60))
    {
    printf("the grade is B \n");

    }
    else
    if((t_mark=50))
    {
    printf("the grade is C \n");

    }
    else
    if((t_mark=40))
    {
    printf("the grade is D \n");

    }
    else
    if((t_mark=0))
    {
    printf("the grade is E \n");

    }

    printf("the final mark is %d \n",t_mark);


    }
     

Share This Page