Using structures, write an interactive C program to generate Grade Card for MCA first semester courses for 20 students of your study centre
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
#include
struct student
{
char name[50];
int roll;
float marks;
int mcs011, mcs012, mcs013, mcs014, mcs015, mcsl016, mcsl017;
int mcs011_assign, mcs012_assign, mcs013_assign, mcs014_assign, mcs015_assign, mcsl016_assign, mcsl017_assign;
};
int main(void)
{
struct student s[20];
for (int i = 0; i < 2; i++) { printf("\n***** Enter information of student %d *****\n", i+1); printf("Name of the student: "); scanf("%s",s[i].name); printf("Roll number: "); scanf("%d", &s[i].roll); printf("\n\n***Enter Term End Theory Matks***\n\n"); printf("MCS-011 marks: "); scanf("%d", &s[i].mcs011); printf("MCS-012 marks: "); scanf("%d", &s[i].mcs012); printf("MCS-013 marks: "); scanf("%d", &s[i].mcs013); printf("MCS-014 marks: "); scanf("%d", &s[i].mcs014); printf("MCS-015 marks: "); scanf("%d", &s[i].mcs015); printf("MCSL-016 marks: "); scanf("%d", &s[i].mcsl016); printf("MCSL-017 marks: "); scanf("%d", &s[i].mcsl017); printf("\n\n***Enter Assignment Marks***\n\n"); printf("MCS-011 marks: "); scanf("%d", &s[i].mcs011_assign); printf("MCS-012 marks: "); scanf("%d", &s[i].mcs012_assign); printf("MCS-013 marks: "); scanf("%d", &s[i].mcs013_assign); printf("MCS-014 marks: "); scanf("%d", &s[i].mcs014_assign); printf("MCS-015 marks: "); scanf("%d", &s[i].mcs015_assign); printf("MCSL-016 marks: "); scanf("%d", &s[i].mcsl016_assign); printf("MCSL-017 marks: "); scanf("%d", &s[i].mcsl017_assign); } for (int i = 0; i < 2; i++) { printf("\n*****Displaying Grade Card Data*****\n"); printf("Name : %s \t", s[i].name); printf("Roll number: %d \n",s[i].roll); printf("Subjects :\t"); printf("MCS-011 \t"); printf("MCS-012 \t"); printf("MCS-013 \t"); printf("MCS-014 \t"); printf("MCS-015 \t"); printf("MCSL-016 \t"); printf("MCSL-017 \n"); printf("Assignment :\t"); printf("%d \t\t", s[i].mcs011_assign ); printf("%d \t\t", s[i].mcs012_assign ); printf("%d \t\t", s[i].mcs013_assign ); printf("%d \t\t", s[i].mcs014_assign ); printf("%d \t\t", s[i].mcs015_assign ); printf("%d \t\t", s[i].mcsl016_assign ); printf("%d \n", s[i].mcsl017_assign ); printf("Theory :\t"); printf("%d \t\t", s[i].mcs011 ); printf("%d \t\t", s[i].mcs012 ); printf("%d \t\t", s[i].mcs013 ); printf("%d \t\t", s[i].mcs014 ); printf("%d \t\t", s[i].mcs015 ); printf("%d \t\t", s[i].mcsl016 ); printf("%d \n", s[i].mcsl017 ); printf("Total :\t\t"); printf("%.2f \t\t", (s[i].mcs011 * 0.75) + (s[i].mcs011_assign * 0.25) ); printf("%.2f \t\t", (s[i].mcs012 * 0.75) + (s[i].mcs012_assign * 0.25) ); printf("%.2f \t\t", (s[i].mcs013 * 0.75) + (s[i].mcs013_assign * 0.25) ); printf("%.2f \t\t", (s[i].mcs014 * 0.70) + (s[i].mcs014_assign * 0.30) ); printf("%.2f \t\t", (s[i].mcs015 * 0.70) + (s[i].mcs015_assign * 0.30) ); printf("%.2f \t\t", (s[i].mcsl016 * 0.70) + (s[i].mcsl016_assign * 0.30) ); printf("%.2f \n", (s[i].mcsl017 * 0.70) + (s[i].mcsl017_assign * 0.30) ); } }
#include
#include
struct gradeCard{
int enroll ;
char course[5][10] ;
int theory[5] ;
int asgmt[5] ;
int wgTheory[5] ;
int wgAsgmt[5] ;
char status[5][15] ;
}std[20] ;
void main(){
int i, j ;
for(i=0; i<20; i++){
printf("\n\nEnter student data…\n") ;
printf("Student %d :-\n",i+1) ;
printf("Enrollment No.:\t") ;
scanf("%d\n",&std[i].enroll) ;
strcpy(std[i].couorse[0],"FEG02") ;
strcpy(std[i].couorse[1],"ECO01") ;
strcpy(std[i].couorse[2],"BCS011") ;
strcpy(std[i].couorse[3],"BCS012") ;
strcpy(std[i].couorse[4],"BCSL013") ;
for(j=0; j<5; j++){
printf("%s theory marks:\t",std[i].course[j]) ;
scanf("%d\n",&std[i].theory[j]) ;
printf("%s asgmt marks:\t",std[i].course[j]) ;
scanf("%d\n",&std[i].asgmt[j]) ;
std[i].wgTheory[j] = 0.75*std[i].theory[j] ;
std[i].wgAsgmt[j] = 0.25*std[i].asgmt[j] ;
if((std[i].wgTheory[j]+std[i].wgAsgmt[j])<40)
strcpy(std[i].status[j],"Not Completed") ;
else
strcpy(std[i].status[j],"Completed") ;
}
}
printf("Data Entry Completed…\n") ;
printf("Press Enter.") ;
getch() ;
clrscr() ;
printf("See grade card one by one…\n\n") ;
for(int i=0; i<20; i++){
printf("Enrollment No. :\t%d\n\n", std[i].enroll) ;
printf("Subject\tTheory\tAsgmt\twgTheory\twgAsgmt\tStatus\n") ;
for(j=0; j<5; j++){
printf("%s\t%d\t%d\t%d\t%d\t%s\n", std[i].course[j], std[i].theory[j], std[i].asgmt[j], std[i].wgTheory[j], std[i].wgAsgmt[j], std[i].status[j]) ;
}
getch() ;
clrscr() ;
printf("\n\n") ;
}
printf("THE END…") ;
}