Mini project in c++,Institute Management has become common now a days but i hope it helps. Accesscode is "nopassword".
Feel free to make chanes according to your need.This has sound involved as well , make sure to adjust it as well.
9. // FUNCTION FORSHOWING A MAIN WINDOWOF FACULTY INFORMATION
voidfaculty()
{
clrscr();
box();
gotoxy(26,4);cout<<"INSTITUTEMANAGEMENTSYSTEM ";
gotoxy(26,5);cout<<"===========================";
gotoxy(26,8);cout<<"Choose YouOption........";
gotoxy(26,10);cout<<"1.AddA New Record";
gotoxy(26,12);cout<<"2.See All Faculty's";
gotoxy(26,14);cout<<"3.Full AccessTo AnyFacultyInformation";
gotoxy(26,16);cout<<"4.ModifyAnyInformation";
gotoxy(26,18);cout<<"5.Delete AnyInformation";
gotoxy(26,20);cout<<"Press0To Exit.......";
gotoxy(26,22);cout<<"Option------>";
cin>>option;
switch(option)
{
case 1 : enterdata();
break;
case 2 : seeyearfaculty();
break;
case 3 : fullaccessfaculty();
break;
10. case 4 : modifyfaculty();
break;
case 5 : deletefaculty();
break;
default:closeprog();
break;
};
}
// FUNCTION TO INSERTA DATA OF FACULTY
voidenterdata()
{
clrscr();
cout<<"Enter The Year Whichyou Want To AddThe Data ";
cout<<" ============================================= ";
gets(year);
mkdir("data");
chdir("data");
mkdir("faculty");
chdir("faculty");
mkdir(year);
chdir(year);
cout<<"Enter The FacultyName : ";
11. gets(name);
mkdir(name);
chdir(name);
personaldetial();
chdir("n");
mainwindow();
}
// FUNCTION TO ENTER A PERSONALDETAILSOF A FACULTY
voidpersonaldetial()
{
cout<<"Enter The Personal Details";
cout<<" ========================== ";
cout<<"Enter The The Name Of A Person:";
gets(name);
mkdir(name);
chdir(name);
strcpy(newfile,"p");
strcat(newfile,name);
strcat(newfile,".txt");
ofstreamfout(newfile);
if(!fout)
{
clrscr();
12. perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
fout<<"NAME: "<<name;
cout<<"Enter The Address:";
gets(temp);
fout<<"ADDRESS:"<<temp;
cout<<"Enter ContactNo.: ";
gets(temp);
fout<<"CONTACTNo.:"<<temp;
fout.close();
encrypt(newfile);
admindetails(name);
}
// FUNCTION TO ENTER A ADMINISTRATION DETAILSOFA FACULTY
voidadmindetails(char*name)
{
clrscr();
13. cout<<"Enter The AdministrationDetials";
cout<<" ================================ ";
strcpy(newfile,"a");
strcat(newfile,name);
strcat(newfile,".txt");
ofstreamfoutt(newfile);
if(!foutt)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
foutt<<"NAME: "<<name;
cout<<"Enter Educational Qualification:";
gets(temp);
foutt<<"EDUCATIONALQUALIFICATIONS:"<<temp;
cout<<"Enter The Name Of The SubjectsTaught";
cout<<" ===================================== ";
foutt<<"SUBJECTSTAUGHT :";
14. cout<<"Subject(s) TaughttoFirstYear: ";
gets(temp);
foutt<<"FirstYear:"<<temp;
cout<<"Type Of Subject(Theory/Practical) :";
gets(temp);
foutt<<"Type of Subject:"<<temp;
cout<<"Subject(s) TaughttoSecondYear:";
gets(temp);
foutt<<"SecondYear:"<<temp;
cout<<"Type Of Subject(Theory/Practical) :";
gets(temp);
foutt<<"Type of Subject:"<<temp;
cout<<"Subject(s) TaughttoThirdYear: ";
gets(temp);
foutt<<"ThirdYear :"<<temp;
cout<<"Type Of Subject(Theory/Practical) :";
gets(temp);
foutt<<"Type of Subject:"<<temp;
15. cout<<"Enter Type of Faculty(Permanent/Visiting)";
gets(temp);
foutt<<"TYPE OFFACULTY :"<<temp;
foutt.close();
encrypt(newfile);
}
// FUNCTION TO ENCRYPTA DATA
voidencrypt(char*newfile)
{
ofstreamfout("temp.txt");
ifstreamfin(newfile);
while(fin)
{
fin.get(ch);
if(ch==EOF)break;
mod=~ch;
fout<<mod;
}
remove(newfile);
rename("temp.txt",newfile);
}
16. // FUNCTION TO SEE THE TOTAL FACULTY OF A YEAR
voidseeyearfaculty()
{
clrscr();
cout<<"Enter The Year Of Which You Want To See The Faculties";
gets(year);
chdir("data");
chdir("faculty");
chdir(year);
cout<<"Enter The FacultyName";
gets(name);
chdir(name);
clrscr();
cout<<" ";
cout<<"These Are The TeachersOf A Stream";
system("dir/b/ad/w");
getch();
chdir("n");
mainwindow();
}
// FUNCTION TO GET FULL ACCESSTO A PARTICULAR DATA
17. voidfullaccessfaculty()
{
clrscr();
chdir("data");
chdir("faculty");
cout<<"Enter The Year Of The Faculty: ";
gets(year);
chdir(year);
cout<<"Enter The Name Of The Faculty: ";
gets(name);
chdir(name);
cout<<"Enter The Name Of A Person: ";
gets(name);
chdir(name);
cout<<"What You Want To See Personal InformationOrAdminInformation";
cout<<"1. Personal ";
cout<<"2. Adminstration";
cout<<"Option------>";
cin>>option;
clrscr();
20. // FUNTION TO MODIFY A FACULTY DATA
voidmodifyfaculty()
{
clrscr();
chdir("data");
chdir("faculty");
cout<<"Enter The Year : ";
gets(year);
chdir(year);
cout<<"Enter The Name Of A Faculty: ";
gets(name);
chdir(name);
cout<<"Enter The Name Of A Person: ";
gets(name);
status=rmdir(name);
if(status==0)
{
personaldetial();
}
21. else
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
chdir("n");
mainwindow();
}
// FUNTION FORDELETING A FACULTY DATA
voiddeletefaculty()
{
clrscr();
chdir("data");
chdir("faculty");
cout<<"Enter The Year : ";
gets(year);
chdir(year);
cout<<"Enter The Name Of A Faculty: ";
gets(name);
22. chdir(name);
cout<<"Enter The Name Of A Person: ";
gets(name);
cout<<"Are You Sure You Want To Remove It(y/n) :";
cin>>ch;
if(ch=='y')
{
status=rmdir(name);
if(status==0)
{
cout<<"RecordHave BeenRemovedSuccesfully";
cout<<"PressAnyKeyTo ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
else
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
}
23. else
{
chdir("n");
mainwindow();
}
}
// FUNCTION FORPRINTINGTHE DATA
voidprin()
{
clrscr();
cout<<"Enter The Option";
cout<<"1. Faculty";
cout<<"2. Student";
cout<<"Option------>";
cin>>option;
chdir("data");
if(option==1)
{
chdir("faculty");
cout<<"Enter The Year ";
gets(year);
chdir(year);
24. cout<<"Enter The Name Of Faculty";
gets(name);
chdir(name);
cout<<"Want Take A PrintDocumentOf Personal OrAdminDetails";
cout<<"1. Personal ";
cout<<"2. Adminstration";
cout<<"Option------>";
cin>>option;
if(option==1)
{
strcpy(newfile,"p");
strcat(newfile,name);
strcat(newfile,".txt");
ifstreamfin;
fin.open(newfile);
if(!fin)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
25. ofstreamfout;
fout.open("PRN");
if(!fout)
{
clrscr();
perror("CannotOpen The File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
while(fin.get(ch)!=0)
{
mod=~ch;
fout.put(mod);
}
fout.close();
fin.close();
}
if(option==2)
{
strcpy(newfile,"a");
strcat(newfile,name);
strcat(newfile,".txt");
ifstreamfin;
26. fin.open(newfile);
if(!fin)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
ofstreamfout;
fout.open("PRN");
if(!fin)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
while(fin.get(ch)!=0)
{
mod=~ch;
fout.put(mod);
}
27. fout.close();
fin.close();
}
}
if(option==2)
{
chdir("student");
cout<<"Enter The Year ";
gets(year);
chdir(year);
cout<<"Enter The Name Of Student";
gets(name);
chdir(name);
cout<<"Want Take A PrintDocumentOf Personal OrAdminDetails";
cout<<"1. Personal ";
cout<<"2. Academic";
cout<<"Option------>";
cin>>option;
if(option==1)
{
strcpy(newfile,"p");
strcat(newfile,name);
strcat(newfile,".txt");
30. perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
while(fin.get(ch)!=0)
{
mod=~ch;
fout.put(mod);
}
fout.close();
fin.close();
}
}
chdir("n");
mainwindow();
}
// FUNCTION FORSHOWING A MAIN WINDOWOF STUDENT INFORMATION
voidstudent()
{
clrscr();
box();
gotoxy(26,4);cout<<"INSTITUTEMANAGEMENTSYSTEM ";
31. gotoxy(26,5);cout<<"===========================";
gotoxy(26,8);cout<<"Choose YouOption........";
gotoxy(26,10);cout<<"1.AddA New StudentRecord";
gotoxy(26,12);cout<<"2.See All Students";
gotoxy(26,14);cout<<"3.Full AccessTo AnyStudentInformation";
gotoxy(26,16);cout<<"4.ModifyAnyInformation";
gotoxy(26,18);cout<<"5.Delete AnyInformation";
gotoxy(26,20);cout<<"Press0To Exit.......";
gotoxy(26,22);cout<<"Option------>";
cin>>option;
switch(option)
{
case 1 : enterdatast();
break;
case 2 : seetotalst();
break;
case 3 : fullaccessst();
break;
case 4 : modifyst();
break;
case 5 : deletest();
break;
default:closeprog();
break;
32. };
}
// FUNCTION TO ENTER A STUDENT DATA
voidenterdatast()
{
clrscr();
cout<<"Enter The Year Whichyou Want To AddThe Data ";
cout<<" =============================================== ";
gets(year);
mkdir("data");
chdir("data");
mkdir("student");
chdir("student");
mkdir(year);
chdir(year);
personalst();
chdir("n");
mainwindow();
}
// FUNCTION TO ENTER A PERSONALDETAILSOF A STUDENT
voidpersonalst()
{
33. cout<<"Enter The Personal Details";
cout<<" ========================== ";
cout<<"Enter The The Name Of The Student: ";
gets(name);
mkdir(name);
chdir(name);
strcpy(newfile,"p");
strcat(newfile,name);
strcat(newfile,".txt");
ofstreamfout(newfile);
if(!fout)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
fout<<" NAME : "<<name;
cout<<"FathersName : ";
gets(temp);
fout<<"FathersName :"<<temp;
cout<<"Date Of Birth : ";
34. gets(temp);
fout<<"Date Of Birth : "<<temp;
cout<<"Contact Number: ";
gets(temp);
fout<<"ContactNumber: "<<temp;
cout<<"Address: ";
gets(temp);
fout<<"ADDRESS:"<<temp;
cout<<"Course Name : ";
gets(temp);
fout<<"Course Name :"<<temp;
fout.close();
encrypt(newfile);
academic(name);
}
// FUNCTION TO ENTER A ACADEMICDETAILS OF A STUDENT
voidacademic(char*name)
{
clrscr();
cout<<"Enter The AcademicDetials";
cout<<" ========================== ";
strcpy(newfile,"a");
36. foutt<<"Percentage InIntermediate :"<<temp;
cout<<"Percentage InCollege :";
foutt<<"Percentage InCollege :";
cout<<"First Year: ";
gets(temp);
foutt<<"FirstYear:"<<temp;
cout<<"SecondYear : ";
gets(temp);
foutt<<"SecondYear:"<<temp;
cout<<"Third Year : ";
gets(temp);
foutt<<"ThirdYear :"<<temp;
foutt.close();
encrypt(newfile);
}
// FUNCTION TO SEE A TOTAL STUDENTS OF A PARTICULARYEAR
voidseetotalst()
{
clrscr();
chdir("data");
chdir("student");
37. cout<<"Enter The Year Of Which You Want To See The Students";
gets(year);
chdir(year);
cout<<"These Are The Students";
system("dir/b/ad/w");
getch();
chdir("n");
mainwindow();
}
// FUNCTION TO SEE ALL DETAILS OF A STUDENT
voidfullaccessst()
{
clrscr();
chdir("data");
chdir("student");
cout<<"Enter The Year Of The Student : ";
gets(year);
chdir(year);
cout<<"Enter The Name Of The Student:";
gets(name);
38. chdir(name);
cout<<"What You Want To See Personal InformationOrAcademicInformation";
cout<<"1. Personal ";
cout<<"2. Academic";
cout<<"Option------>";
cin>>option;
clrscr();
cout<<" ";
if(option==1)
{
strcpy(newfile,"p");
strcat(newfile,name);
strcat(newfile,".txt");
ifstreamfin(newfile);
if(!fin)
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO Return To Main Menu ";
getch();
chdir("n");
mainwindow();
}
41. {
personalst();
}
else
{
clrscr();
perror("CannotOpenThe File ");
cout<<"PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
chdir("n");
mainwindow();
}
// FUNCTION TO DELETE A STUDENT RECORD
voiddeletest()
{
clrscr();
chdir("data");
chdir("student");
cout<<"Enter The Year : ";
gets(year);
42. chdir(year);
cout<<"Enter The Name Of A Student: ";
gets(name);
cout<<"Are You Sure You Want To Remove It(y/n) :";
cin>>ch;
if(ch=='y')
{
status=rmdir(name);
if(status==0)
{
cout<<"RecordHave BeenRemovedSuccesfully";
cout<<"PressAnyKeyTo ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
else
{
clrscr();
perror("CannotOpenThe File ");
cout<<" PRESS ANYKEY TO ReturnTo Main Menu ";
getch();
chdir("n");
mainwindow();
}
}
43. else
{
chdir("n");
mainwindow();
}
}
// FUNCTION TO CLOSE A PROGRAM
voidcloseprog()
{
grap();
setcolor(6);
for(i=0;i<=220;i++)
{
rectangle(0+i,0+i,640-i,480-i);
delay(15);
}
for(i=0;i<=220;i++)
{
rectangle(100+i,100,540-i,380);
delay(10);
}
quit();
closegraph();
exit(0);