0% found this document useful (0 votes)
262 views

Assingment Cprogramming Oum

This document contains a C program for a simple grading system. The program allows the user to input the number of students and subjects. It then loops through each student, taking their ID, marks for each subject, calculating their total, average and grade. The user can choose to input details for another student or end the program. The program was written by Afhom Bin Aminudin for the September 2010 semester of the CBCP2103 Computer Programming course.

Uploaded by

afham_aminudin
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views

Assingment Cprogramming Oum

This document contains a C program for a simple grading system. The program allows the user to input the number of students and subjects. It then loops through each student, taking their ID, marks for each subject, calculating their total, average and grade. The user can choose to input details for another student or end the program. The program was written by Afhom Bin Aminudin for the September 2010 semester of the CBCP2103 Computer Programming course.

Uploaded by

afham_aminudin
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

FACULTY OF IT AND MULTIMEDIA COMMUNICATION

CBCP2103

COMPUTER PROGRAMMING

ASSIGNMENT TITLE

SIMPLE GRADING SYSTEM

Name

AFHAM BIN AMINUDIN


Matric number

XXXXXX
NRIC

XXXXXX
Telephone number

XXXXXXX
E-mail address

XXXXXXX
Tutor’s name

MOHAMED AZWAN BIN MOHAMED YUSOFF

Learning Centre

SERDANG RAYA LEARNING CENTER

Semester

SEPTEMBER 2010
/*AFHAM BIN AMINUDIN*/

/*ASSINGMENT SEPTEMBER 2010 SEMESTER*/

/*CBCP2103*/

#include <stdio.h>

#include <string.h>

int main(void)

int student, subject, i,j;

char studid[20], startloop[1];

float average,total,marks;

strcpy(startloop,"Y");

printf("SIMPLE GRADING SYSTEM\n");

do{

printf("\nEnter no. of students:");

scanf("%d",&student);

printf("\nEnter no of subjects:");

scanf("%d",&subject);

for(i=1; i<= student; i++)

total=0;

printf("\n\n\t >>Enter students ID:");


scanf("%s", &studid);

printf("\n\t >>Enter marks for %s",studid);

for(j=1;j<=subject;j++){

printf("\n\n\t\t Enter mark for subject #%d: ",j);

scanf("%f",&marks);

if((marks>=80)&&(marks<=100)){

printf("\n\t\t Grade: A");

}else if((marks>=70)&&(marks<=79)){

printf("\n\t\t Grade: B");

}else if((marks>=60)&&(marks<=69)){

printf("\n\t\t Grade: C");

}else if((marks>=50)&&(marks<=59)){

printf("\n\t\t Grade: D");

}else if((marks>=40)&&(marks<=49)){

printf("\n\t\t Grade: E");

}else if((marks>=0)&&(marks<=39)){

printf("\n\t\t Grade: F");

} /* end if((marks>=80)&&(marks<=100)){ */

total=total+marks;

} /* end for(j=1;j<=subject;j++){ */

printf("\n\n\t\t Total Marks: %3.0f",total);


average = total/subject;

printf("\n\t\t Average Marks: %3.2f",average);

if(average>=40){

printf("\n\n\t\t PROCEED TO THE NEXT SEMESTER...");

}else{

printf("\n\n\t\t FAILED...");

} /* end if(average>=40){ */

} /* end for(i=1; i<= student; i++)*/

printf("\n\n\t\t ENTER NEXT DATA? PRESS Y TO CONTINUE: ");

scanf("%s",&startloop);

printf("%s",startloop);

}while ( !(strcmpi(startloop,"Y"))); /* end do( */

return 0;

/* startloop =='Y' */

You might also like