A C program to calculate total score of assignment student selected and display it – IGNOU MCA Assignment 2015 – 16

By | September 3, 2015

MASTER OF COMPUTER APPLICATIONS

Course Code : MCS-011
Course Title : Problem Solving and Programming
Assignment Number : MCA(I)/011/Assignment/15-16
Maximum Marks : 100
Weightage : 25%

 

Write an interactive C program to manage the assignments at study centres for the first semester courses of MCA (MCS-011, 012, 13, 014, 015, MCSL-016 and MCSL-017). Maximum marks for each assignment is 100 marks and weightage is 25%. Attending the viva-voce at the study centre for each assignment is compulsory. Pass percentage in each assignment is 40%.

(Note: Use Structures concept).

#include<stdio.h>
struct student
{
unsigned long int ENROL;
char NAME[15];
int MCS011,MCS11V,MCS012,MCS12V,MCS013,MCS13V,MCS014,MCS14V,MCS015,MCS15V,MCS016,MCS16V,MCSL017,MCSL17V;
}STUD[12]={
{102038400,”GANESH”,55,15,78,16,45,18,56,14,75,16,64,17,75,12},
{102038401,”MAHESH”,80,14,56,14,51,11,61,18,56,14,49,16,78,14},
{102038402,”SURESH”,51,12,75,13,16,14,18,14,71,14,19,14,51,11},
{102038403,”KALPESH”,78,10,79,14,74,14,54,12,15,11,61,14,64,13},
{102038404,”RAHUL”,74,17,65,15,45,13,41,11,55,14,56,12,54,10},
{102038405,”SUBBU”,19,13,64,12,68,10,67,14,45,11,64,14,65,12},
{102038406,”RAKESH”,55,11,78,19,45,17,56,14,75,11,64,12,75,13},
{102038407,”ATUL”,55,10,78,12,45,11,56,14,75,13,64,11,75,12},
{102038408,”DHARMESH”,55,16,78,17,45,11,56,14,75,14,64,12,75,14},
{102038409,”AJAY”,55,13,78,14,45,11,56,12,75,15,64,14,75,15},
{102038410,”ABDUL”,55,15,78,17,45,11,56,12,75,15,64,14,75,16},
{102038411,”RASHMI”,55,17,78,15,45,11,56,12,75,14,64,12,75,15}
};
void main()
{

unsigned long int ENROL_NO;
void gen_result(unsigned long int);
clrscr();

printf(“ENTER THE Enroll bwtn 102038399 to 8412 : “);
scanf(“%ld”,&ENROL_NO);
if(ENROL_NO>102038399 && ENROL_NO<102038412)
gen_result(ENROL_NO);
else
printf(“\nYOU HAVE ENTERED WRONG ENROLMENT NO. !!”);
getch();
}
void gen_result(unsigned long int ENROL)
{
char STATUS;
int M011,M012,M013,M014,M015,M016,M017;
M011=STUD[ENROL-102038400].MCS011+STUD[ENROL-102038400].MCS11V;
M012=STUD[ENROL-102038400].MCS012+STUD[ENROL-102038400].MCS12V;
M013=STUD[ENROL-102038400].MCS013+STUD[ENROL-102038400].MCS13V;
M014=STUD[ENROL-102038400].MCS014+STUD[ENROL-102038400].MCS14V;
M015=STUD[ENROL-102038400].MCS015+STUD[ENROL-102038400].MCS15V;
M016=STUD[ENROL-102038400].MCS016+STUD[ENROL-102038400].MCS16V;
M017=STUD[ENROL-102038400].MCSL017+STUD[ENROL-102038400].MCSL17V;
printf(“\n\t\tINDIRA GANDHI NATIONAL OPEN UNIVERSITY”);
printf(“\n\t\t\t(ASSIGNMENT – 2015-2016)”);
printf(“\n\n\tENROLMENT NO.\t: %ld”,ENROL);
printf(“\n\tNAME\t\t: %s”,STUD[ENROL-102038400].NAME);
printf(“\n\tPROGRAMME CODE \t: MCA”);
printf(“\n\t_______________________________________________________________”);
printf(“\n\tCOURSE\t\tASSIGN\t\tVIVA\t\tTOTAL”);
printf(“\n\t CODE \t\t(80%)\t\t(20%)\t\t(100%)\tSTATUS”);
printf(“\n\t_______________________________________________________________”);
if(M011<40) STATUS=’N'; else STATUS=’S';
printf(“\n\tMCS011\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS011,STUD[ENROL-102038400].MCS11V,M011,STATUS);
if(M012<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCS012\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS012,STUD[ENROL-102038400].MCS12V,M012,STATUS);
if(M013<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCS013\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS013,STUD[ENROL-102038400].MCS13V,M013,STATUS);
if(M014<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCS014\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS014,STUD[ENROL-102038400].MCS14V,M014,STATUS);
if(M015<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCS015\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS015,STUD[ENROL-102038400].MCS15V,M015,STATUS);
if(M016<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCS016\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCS016,STUD[ENROL-102038400].MCS16V,M016,STATUS);
if(M017<40) STATUS=’N'; else STATUS=’S';
printf(“\n\n\tMCSL017\t\t%d\t\t%d\t\t%d\t%cC”,STUD[ENROL-102038400].MCSL017,STUD[ENROL-102038400].MCSL17V,M017,STATUS);
printf(“\n\t_______________________________________________________________”);
printf(“\n\t\tSC :- SUCCESSFULL COMPLETED\tNC :- NOT COMPLETED”);
}

Code:

#include<stdio.h>
struct student
{
unsigned long int ENROL;
char NAME[15];
int MCS011,MCS11V,MCS012,MCS12V,MCS013,MCS13V,MCS014,MCS14V,MCS015,MCS15V,MCS016,MCS16V,MCSL017,MCSL17V;
}STUD[12]={
{102038400,"GANESH",55,15,78,16,45,18,56,14,75,16,64,17,75,12},
{102038401,"MAHESH",80,14,56,14,51,11,61,18,56,14,49,16,78,14},
{102038402,"SURESH",51,12,75,13,16,14,18,14,71,14,19,14,51,11},
{102038403,"KALPESH",78,10,79,14,74,14,54,12,15,11,61,14,64,13},
{102038404,"RAHUL",74,17,65,15,45,13,41,11,55,14,56,12,54,10},
{102038405,"SUBBU",19,13,64,12,68,10,67,14,45,11,64,14,65,12},
{102038406,"RAKESH",55,11,78,19,45,17,56,14,75,11,64,12,75,13},
{102038407,"ATUL",55,10,78,12,45,11,56,14,75,13,64,11,75,12},
{102038408,"DHARMESH",55,16,78,17,45,11,56,14,75,14,64,12,75,14},
{102038409,"AJAY",55,13,78,14,45,11,56,12,75,15,64,14,75,15},
{102038410,"ABDUL",55,15,78,17,45,11,56,12,75,15,64,14,75,16},
{102038411,"RASHMI",55,17,78,15,45,11,56,12,75,14,64,12,75,15}
};
void main()
{
unsigned long int ENROL_NO;
void gen_result(unsigned long int);
clrscr();
printf("ENTER THE Enroll bwtn 102038399 to 8412 : ");
scanf("%ld",&ENROL_NO);
if(ENROL_NO>102038399 && ENROL_NO<102038412)
gen_result(ENROL_NO);
else
printf("\nYOU HAVE ENTERED WRONG ENROLMENT NO. !!");
getch();
}
void gen_result(unsigned long int ENROL)
{
char STATUS;
int M011,M012,M013,M014,M015,M016,M017;
M011=STUD[ENROL-102038400].MCS011+STUD[ENROL-102038400].MCS11V;
M012=STUD[ENROL-102038400].MCS012+STUD[ENROL-102038400].MCS12V;
M013=STUD[ENROL-102038400].MCS013+STUD[ENROL-102038400].MCS13V;
M014=STUD[ENROL-102038400].MCS014+STUD[ENROL-102038400].MCS14V;
M015=STUD[ENROL-102038400].MCS015+STUD[ENROL-102038400].MCS15V;
M016=STUD[ENROL-102038400].MCS016+STUD[ENROL-102038400].MCS16V;
M017=STUD[ENROL-102038400].MCSL017+STUD[ENROL-102038400].MCSL17V;
printf("\n\t\tINDIRA GANDHI NATIONAL OPEN UNIVERSITY");
printf("\n\t\t\t(ASSIGNMENT - 2015-2016)");
printf("\n\n\tENROLMENT NO.\t: %ld",ENROL);
printf("\n\tNAME\t\t: %s",STUD[ENROL-102038400].NAME);
printf("\n\tPROGRAMME CODE \t: MCA");
printf("\n\t_______________________________________________________________");
printf("\n\tCOURSE\t\tASSIGN\t\tVIVA\t\tTOTAL");
printf("\n\t CODE \t\t(80%)\t\t(20%)\t\t(100%)\tSTATUS");
printf("\n\t_______________________________________________________________");
if(M011<40) STATUS='N'; else STATUS='S';
printf("\n\tMCS011\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS011,STUD[ENROL-102038400].MCS11V,M011,STATUS);
if(M012<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCS012\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS012,STUD[ENROL-102038400].MCS12V,M012,STATUS);
if(M013<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCS013\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS013,STUD[ENROL-102038400].MCS13V,M013,STATUS);
if(M014<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCS014\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS014,STUD[ENROL-102038400].MCS14V,M014,STATUS);
if(M015<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCS015\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS015,STUD[ENROL-102038400].MCS15V,M015,STATUS);
if(M016<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCS016\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCS016,STUD[ENROL-102038400].MCS16V,M016,STATUS);
if(M017<40) STATUS='N'; else STATUS='S';
printf("\n\n\tMCSL017\t\t%d\t\t%d\t\t%d\t%cC",STUD[ENROL-102038400].MCSL017,STUD[ENROL-102038400].MCSL17V,M017,STATUS);
printf("\n\t_______________________________________________________________");
printf("\n\t\tSC :- SUCCESSFULL COMPLETED\tNC :- NOT COMPLETED");
}

Screen Shots:

C_program_Student_Assign

C_program_Student_Assign_Output