Chettinad Vidyashram R.A. Puram, Chennai 28: Name: Class & Section: Enroll No
Chettinad Vidyashram R.A. Puram, Chennai 28: Name: Class & Section: Enroll No
Chettinad Vidyashram R.A. Puram, Chennai 28: Name: Class & Section: Enroll No
PURAM, CHENNAI 28
4.
PROGRAM
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
struct student
int eno;
char name[25];
struct marks
int subcode;
}record;
} result[10];
void line()
cout<<"_";
int total(int i)
int i,j;
for(i=0;i<limit;i++)
cout<<" Enter exam no. \t : "; cin>>result[i].eno; cout<<" \n Enter your name \t :"; gets(result[i].name); cout<<" \n Enter the subject name \t:"; gets(result[i].record.subname); cout<<"\n Enter the external mark \t :"; cin>>result[i].record.extmark;
cout<<" \n Enter the internal mark \t :"; cin>>result[i].record.intmark; cout<<" \n Enter the subject no. \t :"; cin>>result[i].record.subcode;
int i,j,dd,mm,yy,semester,t; cout<<" Enter the semester : "; cin>>semester; cout<<"\n Enter the date in dd/mm/yy format :"; cin>>dd>>mm>>yy; student temp;
for(i=0;i<limit;i++)
for(j=i+1;j<limit;j++)
if(strcmp(result[i].name,result[j].name)>0)
temp=result[i]; result[i]=result[j];
result[j]=temp;
char grade[4]; cout<<" After arranging names in alphabetical order \n "; for (i=0;i<limit;i++)
strcpy(grade,"FAIL"); cout<<"\n Semester: "<<semester<<" \t \t \t Date: "<<dd<<"/"<<mm<<"/"<<yy<<endl; cout<<"\n Name: "<<result[i].name<<"\n \n"; cout<< " Exam no: "<<result[i].eno; line(); cout<<"\n S.No \t Subject code \t Subject name \t Internal Mark \t External Mark \t Result \n"; cout<<"\n "<<i+1<<" \t \t "<<result[i].record.subcode<<" \t \t "<<result[i].record.subname<<" \t \t "<<result[i].record.intmark<<" \t \t "<<result[i].record.extmark<<" \t \t "<<grade; line();
char grade[4]; strcpy(grade,"\0"); int t,dd,mm,yy,semester; cout<<"Enter the semester : "; cin>>semester; cout<<"\n Enter the date in dd/mm/yy format :"; cin>>dd>>mm>>yy;
for(int i=0;i<limit;i++)
t=total(i);
cout<<"\n Semester: "<<semester<<" \t \t \t Date: "<<dd<<"/"<<mm<<"/"<<yy<<endl; cout<<"\n Name: "<<result[i].name<<"\n \n"; cout<<" Exam no: "<<result[i].eno;
line();
cout<<"\n S.No \t Subject code \t Subject name \t Internal Mark \t External Mark \t Result \n"; cout<<"\n "<<i+1<<" \t "<<result[i].record.subcode<<" \t "<<result[i].record.subname<<" \t "<<result[i].record.intmark<<" \t "<<result[i].record.extmark<<" \t "<<grade;
line();
getch();
char replace[25]; int i; cout<<"\n Enter the name who's internal mark and external mark you want to change"; gets(replace);
for(i=0;i<limit;i++)
if(strcmp(result[i].name,replace)==0)
cout<<"\n Change the internal mark: "; cin>>result[i].record.intmark; cout<<"\n Change the external mark: "; cin>>result[i].record.extmark;
void main()
clrscr();
int i,j,ich,t,limit;
do
cout<<endl<<endl<<" 1) Accept the value \n 2) Display the value \n 3) Edit and display the details with recent changes \n 4) Sort the entries \n 5) Exit \n Enter your choice: ";
cin>>ich;
switch(ich)
case 1:
break;
case 2:
display(limit);
break;
case 3:
edit(limit);
display(limit);
break;
case 4:
sort(limit);
break;
case 5:
exit(0);
default:
getch();
while(ich!=5);
OUTPUT:
Welcome to the program Your choices are 1) Accept the values 2) Display the values 3) Edit and display the details with recent changes 4) Sort the entries 5) Exit Enter your choice: 1 Enter limit: 2 Enter exam no: 34 Enter name: Sanjai Enter Subject name: English Enter the external mark: 69 Enter the internal mark: 24 Enter the subject no: 1 Enter exam no: 33
Enter name: Rama Enter Subject name: English Enter the external mark: 20 Enter the internal mark:20 Enter the subject no: 1
Welcome to the program Your choices are 1) Accept the values 2) Display the values 3) Edit and display the details with recent changes 4) Sort the entries 5) Exit Enter your choice: 2 Enter the semester: 1 Enter the date in dd/mm/yy format: 15 02 12
Date:
S.no Subject code Subject name Internal Mark mark Result 1 PASS 1 English 29
External 64
Semester: 1 15/02/12 Name: Rama Exam no: 33 S.no Subject code Subject name Internal Mark mark Result 1 FAIL 1 English 20
Date:
External 20
Welcome to the program Your choices are 1) Accept the values 2) Display the values 3) Edit and display the details with recent changes 4) Sort the entries 5) Exit Enter your choice: 3 Enter the name whos internal mark and external mark you want to change: Sanjai
Change the internal mark: 30 Change the external mark:70 Enter the semester:1 Enter the date in dd/mm/yy format: 15 02 12 Semester: 1 15/02/12 Name: Sanjai Exam no: 34 S.no Subject code Subject name Internal Mark mark Result 1 PASS 1 English 30 External 70 Date:
Semester: 1 15/02/12 Name: Rama Exam no: 33 S.no Subject code Subject name Internal Mark mark Result 1 FAIL 1 English 20
Date:
External 20
Welcome to the program Your choices are 1) Accept the values 2) Display the values 3) Edit and display the details with recent changes 4) Sort the entries 5) Exit Enter your choice: 4 After arranging names in alphabetical order, Enter the semester: 1 Enter the date in dd/mm/yy format: 15 02 12 Semester: 1 15/02/12 Name: Rama Exam no: 33 S.no Subject code Subject name Internal Mark mark Result 1 FAIL 1 English 20 External 20 Date:
Date:
Exam no: 34 S.no Subject code Subject name Internal Mark mark Result 1 PASS 1 English 30 External 70
Welcome to the program Your choices are 1) Accept the values 2) Display the values 3) Edit and display the details with recent changes 4) Sort the entries 5) Exit Enter your choice: 5