Monday, September 1, 2014

School Management System in C++

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//              Project By:                                             //
//  Hafiz muhammd usman siddique    //
//  Fatima zuhra jabeen                      //
///////////////////////////////////////////////////////////////////////////////
//      COMSATS institute of information and technology Wah Cantt          //
/////////////////////////////////////////////////////////////////////////////
//    Software engineering:                                     //
//             FA 13 (BS) SE-2C                //
/////////////////////////////////////////////////////////////////////////////




#include<iostream.h>                  //for cout,cin
#include<conio.h>                    //for clrscr(),getch()
#include<string.h>                   //for strcmp(),strcpy();
#include<dos.h>                      //for delay()
#include<stdlib.h>                  //for exit()
#include<stdio.h>                   //for cput(),getc()
char m,c1;
int i=0,s=0,y=0,mi=0,mj=0,j,k;
inline void all();
void line();
void design();
void pass();
class student
{
private:
char name[10];
int roll_no;
int age;
char adress[20];
long ph_no;
float markx;
public:
student()        //constructor
{
 strcpy(name," ");
 roll_no=NULL;
 age=NULL;
 strcpy(adress,"   ");
 ph_no=0;
 markx=0.0;
}
void set_info()
{
line();
cout<<"\n Enter the name of the student:        ";
cin>>name;
cout<<"\n Enter the roll_no:                    ";
cin>>roll_no;
cout<<"\n Enter the age:                        ";
cin>>age;
cout<<"\n Enter the home adress of the student: ";
cin>>adress;
cout<<"\n Enter the phone no of student:        ";
cin>>ph_no;
cout<<"\n Enter the total markx of the student:  ";
cin>>markx;
line();
getch();
clrscr();
}
void display(int r)
{clrscr();
textcolor(5);
textbackground(0);
roll_no=r;
line();
cout<<"\n\n     STUDENT DETAIL | ROLL NO "<<r<<"      \n";
cout<<"\n\t Name:         "<<name;
cout<<"\n\t Age:          "<<age;
cout<<"\n\t markx:        "<<markx;
cout<<"\n\t phone no:     " <<ph_no;
cout<<"\n\t Roll no:      "<<roll_no;
cout<<"\n\t Adress:       "<<adress<<endl;
line();getch();clrscr();
cout<<endl<<endl;
}
void all_display(int s)
{

cout<<"\n"<<s<<"     "<<roll_no<<"     "<<name<<"      "<<age<<"     "<<markx<<"     "<<ph_no<<"     "<<adress;

}
};
/////////////////////////////////////////////////////////////////////////////
//////////////////            MAIN FUNTION      ///////////////////////////
////////////////////////////////////////////////////////////////////////////
void main()
{
clrscr();
pass();
clrscr();
design();

clrscr();
line();
textcolor(6);
textbackground(1);
student a1[20],a2[20],a3[20],a4[20],a5[20],a6[20],a7[20],a8[20],a9[20],a10[20];
char a=' ';
q:cout<<"\n\n\t\t\" SELECT YOUR MODE \"\n\n\n";
cout<<"\n\"For Teacher  Press  T\"\n";
cout<<"\n\"For Student  Press  S\"\n";
cout<<"\n\"For Quit     Press  Q\"\n\n";
cin>>a;
clrscr();
switch(a)
{

case 'q':

{
textcolor(7);
delay(50);
gotoxy(2,10);cout<<endl;
cout<<"\n";
cputs("\n             _/_/_/_/_/  _/                           _/     ");cout<<endl;
cputs("                 _/      _/_/_/      _/_/_/  _/_/_/   _/  _/ ");cout<<endl;
cputs("                 _/      _/   _/   _/    _/  _/   _/  _/_/    ");cout<<endl;
cputs("                 _/      _/   _/   _/    _/  _/   _/  _/ _/  ");cout<<endl;
cputs("                 _/      _/   _/    _/_/_/   _/   _/  _/  _/");cout<<endl;
cout<<"\n\n\n";
cputs("                    _/   _/                     ");cout<<endl;
cputs("                     _/ _/  _/_/_/_/  _/    _/  ");cout<<endl;
cputs("                      _/    _/    _/  _/    _/  ");cout<<endl;
cputs("                      _/    _/    _/  _/    _/  ");cout<<endl;
cputs("                      _/    _/_/_/_/  _/_/_/_/  ");cout<<endl;
}
delay(9991);
exit(0);
break;
case 't':
clrscr();
pass();
char b=' ';
t:    clrscr();  cout<<"\n\n\t\t\" Select Yourr Mode\"\n\n ";
cout<<"\n\"For Insert              Press   I\"\n";
cout<<"\n\"For Checking Data       Press   V\"\n";
cout<<"\n\"For Editing in data     Press   E\"\n";
cin>>b;
clrscr();
switch(b)
{
case 'i':
clrscr();
i: int i=0,s=0;
cout<<"\n\n\t\"Enter Class No:\"";
cin>>i;
if(i==1)
{
cout<<"\n\n 1st Class is open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a1[s].set_info();
}
if(i==2)
{
cout<<"\n 2nd Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a2[s].set_info();
}
if(i==3)
{
cout<<"\n 3rd Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a3[s].set_info();
}
 if(i==4)
{
cout<<"\n 4th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a4[s].set_info();
}
  if(i==5)
{
cout<<"\n 5th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a5[s].set_info();
}
  if(i==6)
{
cout<<"\n 6th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a6[s].set_info();
}
   if(i==7)
{
cout<<"\n 7th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a7[s].set_info();
}
   if(i==8)
{
cout<<"\n 8th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a8[s].set_info();
}
    if(i==9)
{
cout<<"\n 9th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a9[s].set_info();
}
     if(i==10)
{
cout<<"\n 10th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a10[s].set_info();
}
getch();
{

ri:
textcolor(4);
textbackground(7);
cout<<"\n\n\n\"GOTO MAIN MENU\"      PRESS    \"M\"";
cout<<"\n\"GOTO TEACHER MENU\"   PRESS    \"T\"";
cout<<"\n\"GOTO INSERT MENU\"    PRESS    \"I\"";
cin>>m;
if(m=='m'||m=='M')
goto q;
else if(m=='t'||m=='T')
goto t;
else if(m=='i'||m=='I')
goto i;
else
cout<<"\n\n\t\t WORNG CHOISE TRY AGAIN\n\n";
goto ri;
}
// break;
case 'v':
clrscr();
char c=' ';
v: cout<<"\n\n\n\"Select your viewing style\"\n";
cout<<"\n\"For Checking Data of whole class  Press    A\"\n";
cout<<"\n\"For Checking Data of one student  Press    O\"\n";
cin>>c;
clrscr();
switch(c)
{
case 'a':
int a=0;
cout<<"\n\"Enter Class No\"\n";
cin>>a;
if(a==1)
{
all();
for(int i=1;i<=20;i++)
a1[i].all_display(i);
getch();
}
 if(a==2)
{
all();
for(int i=1;i<=20;i++)
a2[i].all_display(i);
}
 if(a==3)
{
all();
for(int i=1;i<=20;i++)
a3[i].all_display(i);
}
 if(a==4)
{
all();
for(int i=1;i<=20;i++)
a4[i].all_display(i);
}
 if(a==5)
{
all();
for(int i=1;i<=20;i++)
a5[i].all_display(i);
}
 if(a==6)
{
all();
for(int i=1;i<=20;i++)
a7[i].all_display(i);
}
 if(a==8)
{
all();
for(int i=1;i<=20;i++)
a8[i].all_display(i);
}
 if(a==9)
{
all();
for(int i=1;i<=20;i++)
a9[i].all_display(i);
}
 if(a==10)
{
all();
for(int i=1;i<=20;i++)
a10[i].all_display(i);
}
vi: {
cout<<"\n\n\n\"GOTO MAIN MENU\"      PRESS    \"M\"";
cout<<"\n\"GOTO TEACHER MENU\"   PRESS    \"T\"";
cout<<"\n\"GOTO VIEW MENU\"      PRESS    \"V\"";
cin>>m;
if(m=='m'||m=='M')
goto q;
else if(m=='t'||m=='T')
goto t;
else if(m=='v'||m=='V')
goto v;
else
cout<<"\n\n WORNG CHOISE TRY AGAIN\n\n";
goto vi;
}
      // break;
case 'o':
clrscr();
{
cout<<"\n\"Enter Desire Class\"\n";
cin>>i;
  if(i==1)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a1[a].display(a);
  }
    if(i==2)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a2[a].display(a);
  }
    if(i==3)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a3[a].display(a);
  }
    if(i==4)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a4[a].display(a);
  }
    if(i==5)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a5[a].display(a);
  }
    if(i==6)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a6[a].display(a);
  }
    if(i==7)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a7[a].display(a);
  }
    if(i==8)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a8[a].display(a);
  }
    if(i==9)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a9[a].display(a);
  }
    if(i==10)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a10[a].display(a);
  }
  }
  {
cout<<"\n\n\n\"GOTO MAIN MENU\"      PRESS    \"M\"";
cout<<"\n\"GOTO TEACHER MENU\"   PRESS    \"T\"";
cout<<"\n\"GOTO VEIW MENU\"      PRESS    \"V\"";
cin>>m;
if(m=='m'||m=='M')
goto q;
else if(m=='t'||m=='T')
goto t;
else if(m=='V'||m=='v')
goto v;
else
cout<<"\n\n WORNG CHOISE TRY AGAIN\n\n";
goto vi;}}
break;
}
break;
case 'e':

e: cout<<"\n\"Enter Class No\"\n";
cin>>i;
if(i==1)
{
cout<<"\n 1st Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a1[s].set_info();
}
if(i==2)
{
cout<<"\n 2nd Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a2[s].set_info();
}
if(i==3)
{
cout<<"\n 3rd Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a3[s].set_info();
}
 if(i==4)
{
cout<<"\n 4th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a4[s].set_info();
}
  if(i==5)
{
cout<<"\n 5th Class is open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a5[s].set_info();
}
  if(i==6)
{
cout<<"\n 6th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a6[s].set_info();
}
   if(i==7)
{
cout<<"\n 7th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a7[s].set_info();
}
   if(i==8)
{
cout<<"\n 8th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a8[s].set_info();
}
    if(i==9)
{
cout<<"\n 9th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a9[s].set_info();
}
     if(i==10)
{
cout<<"\n 10th Class in open \n";
cout<<"\n Enter Roll No \n";
cin>>s;
a10[s].set_info();
}           //////////////////////////
{
ei: cout<<"\n\n\n\"GOTO MAIN MENU\"      PRESS    \"M\"";
cout<<"\n\"GOTO TEACHER MENU\"   PRESS    \"T\"";
cout<<"\n\"GOTO EDIT MENU\"      PRESS    \"E\"";
cin>>m;
if(m=='m'||m=='M')
goto q;
else if(m=='t'||m=='T')
goto t;
else if(m=='e'||m=='E')
goto e;
else
cout<<"\n\n\t WORNG CHOISE TRY AGAIN\n\n";
goto ei;
    // break;
}

//break;
case 's':
  a: {
cout<<"\n\"Enter Desire Class\"\n";
cin>>i;
  if(i==1)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a1[a].display(a);
  }
    if(i==2)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a2[a].display(a);
  }
    if(i==3)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a3[a].display(a);
  }
    if(i==4)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a4[a].display(a);
  }
    if(i==5)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a5[a].display(a);
  }
    if(i==6)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a6[a].display(a);
  }
    if(i==7)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a7[a].display(a);
  }
    if(i==8)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a8[a].display(a);
  }
    if(i==9)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a9[a].display(a);
  }
    if(i==10)
  {
  int a;
  cout<<"\n\" Enter Roll No\"\n";
  cin>>a;
  a10[a].display(a);
  }
  {

z:         clrscr();cout<<"\n\n\n\"GOTO MAIN MENU\"                  Press:   \"M\"\n";                  //return options
   cout<<"\n\n\n\"CHECK ANOTHER STUDENT DETAIL\"    Press:   \"S\"\n";
   cin>>m;
  {
   if(m=='s'||m=='S')
    goto a;
    else if(m=='m'||m=='M')
    goto q;
   else
    cout<<"\n\n\tSORRY WRONG CHOICE \n\n";
    goto z;
   }
     }


    }
 // break;
default:
clrscr();
cout<<"\n\n\n\n\n\n\n\n\nSORRY WRONG CHOICE TRY AGAIN";
delay(900);
goto q; }
getch(
);
}
////////////////////////////////////////////////////////////
void all()
{
cout<<"S.no | Roll no | Name | Age | Markx | Phone no  | Adress\n" ;
}
void line()
{
for(i=0;i<=30;i++)
cout<<char(3);
}
///////////////////////////////////

//////////////////////

void design()
{
textcolor(4);
textbackground(0);
clrscr();
int q=50;
char info[]={" COMSATS INSTITUTE OF INFORMATION AND TECHNOLOGY WAH CANTT"};
gotoxy(28,30);
cout<<" C  O  M  S  A  T  S";
for(int i=0;i<=50;i++)
{
gotoxy(q-i,8);
delay(200);
cout<<"  "<<info<<" ";
}
clrscr();

{              {
textcolor(4);
textbackground(7);
gotoxy(7,3);
cout<<" WELL   COME   TO HIGH SCHOOL   DATA  BASE  MANEGEMENT   SYSTEM";
gotoxy(24,19);
cout<<"L O A D I N G  P R O J E C T  F I L E "<<endl;
gotoxy(28,22);
cout<<"___________";
j=28;
for(int i=0;i<101;i++)
{
gotoxy(41,22);
delay(100);
cout<<i<<"% completed"<<endl;
if(i%10==0)
{
gotoxy(j,22);
j++;
cout<<char(16);
}
}
cout<<"\n\n\t\t\t\tSUCCESSFULLY LOADED" <<endl;     }
c1='s';
{
delay(500);
textbackground(0);
textcolor(6);
clrscr();
int i,x=1;
cout<<"+";
delay(100);
for(i=0;i<78;i++)
{
delay(30);
gotoxy(2+i,1);cputs("+");
if(i<20)
{
gotoxy(1,i+2);cputs("+");
}
if(i==20)

{
gotoxy(1,22);cputs("+");
}
if(i>20)
{
gotoxy(x+1,22);cout<<"+";
x++;
}
}
delay(50);
gotoxy(80,1);cputs("+");
for(i=0;i<22;i++)
{
delay(30);
if(i<20)
{
gotoxy(80,2+i);cputs("+");
}
gotoxy(x+i,22);cputs("+");
if(i==19)
{
gotoxy(80,22);cout<<char(1) ;
}
}
delay(700);
textcolor(4);
gotoxy(2,2);
cputs("+");
for(i=0;i<76;i++)
{
cputs("+");
}
for(i=3;i<21;i++)
{
gotoxy(2,i);cputs("+");
}
gotoxy(2,21);cout<<char(1);
for(i=3;i<79;i++)
{
gotoxy(i,21);cputs("+");
}
cputs("+") ;
for(i=20;i>2;i--)
{
gotoxy(79,i);cputs("+");
}
gotoxy(79,2);
cout<<char(1);
delay(700);
textcolor(1);
gotoxy(3,3);
cputs("+");
for(i=0;i<75;i++)
{
cputs("+");
}
for(i=4;i<21;i++)
{
gotoxy(3,i);
cputs("+");
}
gotoxy(3,20);
cputs("+");
for(i=4;i<78;i++)
{
gotoxy(i,20);
cputs("+");
}
cputs("+");
for(i=19;i>3;i--)
{
gotoxy(78,i);cputs("+");
}
char c, usman[]={"HAFIZ USMAN SIDDIQUE "},fatima[]={"FATIMA ZUHRA JABEEN  "},aneela[]={"ANEELA ASLAM  "};
x=46;
c=char(2);
gotoxy(16,5);
cout<<"PROJECT BY:-";
for(i=0;i<24;i++)
{
delay(500);
textcolor(2);{
gotoxy(x-i,8);cout<<c<<"  "<<usman<<c;
gotoxy(x-i,11);cout<<c<<"  "<<fatima<<c;
gotoxy(x-i,14);cout<<c<<"  "<<aneela<<c;

gotoxy((x-i+31),16);cout<<" ";
}
delay(40);gotoxy(16,18);cout<<"PROJECT SUBMITEED TO:    \" SIR SAQIB HUSSAIN\""<<endl;

gotoxy(65,19);cout<<"  BS-SE-2C"<<endl;
}
 m=10;
 y=47;
for(i=0;i<34;i++)
{
m++;
textcolor(m+8);
textbackground(0);
if(m==17)m=1;
if(i%2==0)
y--;
delay(90);
gotoxy(33,y);
cputs("PREASS ENTER");
delay(100);
gotoxy(33,y+1);
cout<<"              ";
} }  }
getch();
}
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
void pass()
{
char u[]={"usman"},f[]={"fatima"},a[]={"aneela"},pass[7],awe[12];
f:clrscr();
gotoxy(30,15);
cout<<char(3)<<char(3)<<"  AUTHENTICATION REQUIRED  "<<char(3)<<char(3);
gotoxy(26,17);
cout<<"User Name= ";
cin>>awe;
gotoxy(26,19);
cout<<"Pass Word= ";
cin>>pass;
cout<<"\n\nChecking for Username and Password...........\n\n";
{
if(strcmp(pass,a)==0)
h:{
delay(1500);
cout<<"\n\n\t\t\t"<<char(1)<<" LOGIN SUCCESFULY "<<char(1);
cout<<"\n\n\n\n\n\n\t\t\" PRESS ANY KEY TO CONTINUE\"";
getch();
}
else if(strcmp(pass,u)==0)
goto h;
else if(strcmp(pass,f)==0)
goto h;
else {

cout<<"\n\n\n\n\n\n\n\n\n\t\t\"SORY WORNG USERNAME OR PASSWORD\"\n\n\t TRY AGIAN ";
delay(1800);
goto f;}
}}

Share this

0 Comment to "School Management System in C++"