Sei sulla pagina 1di 12

#include<iostream.

h>
#include<conio.h>
#include<graphics.h>
#include<string.h>
#include<dos.h>
#include<stdlib.h>
#include<iomanip.h>
#include<fstream.h>
#include <time.h>
#include <stdio.h>
int t,did,tempno=0,n,college,branch,di=0,noc,i,j,totalseat,temptotalseat;
void graphics1()
{
h:
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
setcolor(RED);
setbkcolor(1);
settextjustify(CENTER_TEXT, CENTER_TEXT);
settextstyle(1,0,5);
outtextxy((getmaxx()/2-20),(getmaxy()/2-20)," ENTER PASSWORD");
char pass[4];
for(int ii=0;ii<15;ii++)
{
cout<<"\n ";
}
cout<<"\t\t ENTER PASSWORD OF FIVE DIGITS= ";
strcpy(pass,"aaaaa");
for(int i=0;i<5;i++)
{
t=getch();
pass[i]=t;
cout<<"*";
}
int compare=strcmp(pass,"SVMIT");
if(compare!=0)
{
setcolor(9);
outtextxy((getmaxx()/2-20),(getmaxy()/2+60)," WRONG PASSWORD");
getch();
cout<<"\n\t\t\tDO YOU WANT TO TRY AGAIN WRITE[Y/N]=";
char want;
cin>>want;
if(want=='y'|| want=='Y')
{
goto h;
}
exit(0);
}
setcolor(9);
settextstyle(1,0,4);
outtextxy((getmaxx()/2-20),(getmaxy()/2+90),"PASSWORD ACCEPECTED");
settextstyle(1,0,3);
delay(1000);
outtextxy((getmaxx()/2)-30,(getmaxy()/2+150),"PLEASE WAIT");
for(i=0;i<90;i+=5)
{
putpixel((getmaxx()/2)+i+50,(getmaxy()/2+160),15);
delay(200);
}
settextstyle(1,0,5);
setcolor(4);
outtextxy(300, 450,"BY=CHINTAN & SONIL");
delay(2500);
}

void graphics2()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
int x1,x2;
setcolor(RED);
setbkcolor(WHITE);
settextjustify(CENTER_TEXT, CENTER_TEXT);
setcolor(BLUE);
for(x1=110,x2=113;x1<520,x2<523;x1+=3,x2+=3)
{
i=random(15);
if(x1>517){i=4;}
setcolor(i);
settextstyle(1,0,9);
outtextxy(280,200," LOADING");
setfillstyle(SOLID_FILL,BLUE);
bar(x1,400,x2,440);
delay(90);
}
setcolor(RED);
settextstyle(3,0,8);
outtextxy(300, 290,"SUCCESSFULLY");
settextstyle(1,0,3);
outtextxy(300, 450,"PLEASE ENTER ANY KEY");
getch();
}

void graphics3()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
int x,y,i,len;
clrscr();
len=strlen("WELCOME");
len=len*50;
len=0-len;
x=625;
y=180;
while(1)
{
if(kbhit())
{
goto hhh;
}
i=random(15);
setcolor(i);
settextstyle(TRIPLEX_FONT,0,len);
outtextxy(x,y,"WELCOME");
delay(20);
if(x==len-180)
x=625;
else
x=x-5;
cleardevice();
}
hhh:
closegraph();
}

void graphics4()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
int x1,y1;
for(i=0;i<15;i+=5)
{
setcolor(2+i);
ellipse(320,240,0,360,187+i,227+i);
}
for(i=0;i<15;i+=5)
{
setcolor(2+i);
line(0,150+i,150+i,0);
}
for(i=0;i<15;i+=5)
{
setcolor(2+i);
line(639,150-i,639-150+i,0);
}
for(i=0;i<15;i+=5)
{
setcolor(2+i);
line(639,479-150-i,639-150-i,479);
}
for(i=0;i<15;i+=5)
{
setcolor(i+2);
line(0,479-150+i,150-i,479);
}
while(3)
{
if(kbhit())
{
goto hhhh;
}
i=random(15);
setcolor(i);
settextstyle(TRIPLEX_FONT,0,2);
outtextxy(200,150,"PROGRAMME OF ADDMISSION");
setcolor(i+1);
outtextxy(138,180,"PROGRAMMING BY CHINTAN DALWADI");
setcolor(i+2);
outtextxy(145,210,"S.V.M.I.T ENGG. COLLEGE, BHARUCH");
setcolor(i+3);
outtextxy(215,240,"III YEAR COMPUTER");
setcolor(i+5);
outtextxy(215,270,"DATE=22/10/2009");
setcolor(i+4);
outtextxy(170,300,"chintandalwadi310@gmail.com");
setcolor(4);
outtextxy(290,350,"IN");
setcolor(15);
outtextxy(311,350,"D");
setcolor(2);
outtextxy(322,350,"IA");
delay(90);
}
hhhh:
getch();
cleardevice();
closegraph();
}

int check(int da)


{
if(da==0)
{
cout<<"\n\n\t\t\tSEAT IS FULL";
cout<<"\n\t\t::PLESE ENTER ANOTHER CHOISE::";
return 0;
}
return 1;
}

class college
{
public:
int seat[20],branch;
char branchname[20][15],collegename[30];
}coll[10];
class student
{
public:
char fname[20],mname[20],lname[20],name[40];
float per,english,ten;
char college[15],branch[15];
int maritno,id,min,sec,hour,y,dd,mon;
void set()
{
textcolor(4);
cprintf("\nENTER FULL NAME[first middle last]=");
cin>>fname>>mname>>lname;
invalid:
cprintf("ENTER PERCENTAGE=");
cin>>per;
cprintf("ENTER 12th ENGLISH MARKS=");
cin>>english;
cprintf("ENTER TEN'TH PERCENTAGE=");
cin>>ten;
strcpy(name,fname);
strcat(name," ");
strcat(name,mname);
strcat(name," ");
strcat(name,lname);
}
void display()
{
cout<<"\n"<<maritno<<setw(34)<<name<<setw(32)<<per<<setw(10)<<id
;
}
void display1()
{
textcolor(4);
cout<<"\n"<<maritno<<setw(22)<<name<<setw(6)<<per<<setw(12)<<col
lege<<setw(8)<<branch<<setw(8)<<id<<setw(4)<<dd<<"/"<<mon<<"/"<<y<<setw(4)<<hour
<<":"<<min<<":"<<sec;
}
}stu[30];

void main()
{
clock_t start, end;
start = clock();
struct time tt;
struct date d;

graphics1();
graphics2();
graphics3();
here:
int enter;
fstream file;
fstream file1;
fstream file3;
file.open("admain.dat",ios::in|ios::out|ios::binary);
file1.open("idmain.dat",ios::in|ios::out|ios::binary);
clrscr();
textcolor(132);
gotoxy(3,3);cprintf(" ADDMISSION PROGRAMME ")
;
textcolor(4);
cprintf("\r\nENTER");
textcolor(1);
cprintf(" 1=FOR ENTER COLLEGE\r\n 2=FOR ADD STUDENT\r\n 3=FOR
ADMISSION\r\n 4=FOR EXIT\r\n 5=FOR SHOW LIST OF ALL STUDENT ADDMISSION
INFORMATION\r\n 6=FOR FINDING STUDENT ADDMISSION INFORMATION BY IT'S ID\r\
n 7=FOR THIS PROGRAM INFORMATION");
textcolor(132);
cprintf("\r\n\r\n\r\n\r\n PLEASE ENTER YOUR CHOI
CE");
textcolor(1);
cprintf("\r\n\r\n\r\n PLEASE ENTER=");
cin>>enter;
switch(enter)
{
case 1:
{
clrscr();
textcolor(4);
cprintf("\r\nENTER NO. OF COLLEGE=");
textcolor(15);
cin>>noc;
for(i=0;i<noc;i++)
{
clrscr();
textcolor(4);
cprintf("ENTER %d COLLEGE NAME=",i+1);
textcolor(14);
cin>>coll[i].collegename;
textcolor(4);
cprintf("\r\n\r\n\r\nENTER NUMBER OF BRANCH===")
;
textcolor(15);
cin>>coll[i].branch;
for(int aa=0;aa<coll[i].branch;aa++)
{
textcolor(4);
cout<<"\n\n\n\t\t\t\tENTER "<<aa+1<<" BR
ANCH NAME=";
textcolor(15);
cin>>coll[i].branchname[aa];
textcolor(4);
cout<<"\n\t\t\t\tENTER SEAT OF "<<coll[i
].branchname[aa]<<" BRANCH=";
textcolor(15);
cin>>coll[i].seat[aa];
totalseat+=coll[i].seat[aa];
}
}
temptotalseat=totalseat;
goto choise;
}
case 2:
{
clrscr();
textcolor(4);
cprintf("ENTER NUMBER OF STUDENT YOU WANT TO ENTER=");
cin>>n;
tempno=n;
file1.seekp(0,ios::beg);
while(file1.read((char*)&did,sizeof(did)))
{
}
file1.clear();
for(int ii=0;ii<n;ii++)
{
stu[ii].id=did+ii+1001;
stu[ii].maritno=ii+1;
stu[ii].set();
}
did=stu[ii-1].id-1000;
file1.seekg(0,ios::beg);
file1.write((char*)&did,sizeof(did));
file1.close();
clrscr();
textcolor(9);
for(i=0;i<80;i++)
{
cprintf("-");
}
cout<<"\nSR. NO "<<setw(25)<<"NAME"<<setw(35)<<"PERCENT
AGE"<<setw(7)<<"ID\n";
for(i=0;i<80;i++)
{
cprintf("-");
}
for(ii=0;ii<n;ii++)
{
stu[ii].display();
}
textcolor(10);
cprintf("\r\n\r\r\nDO YOU WANT TO SHOW MARIT NUMBER ?\r\
nIF YES WRITE Y==");
t=getch();
textcolor(4);
cprintf("\invalid choise");
if(t=='y' || t=='Y')
{
float large,index,i,j,denglish,dten;
int tempid;
char g[100];
clrscr();
for(i=n-1;i>0;i--)
{
large=stu[0].per;
index=0;
denglish=stu[0].english;
dten=stu[0].ten;
for(j=1;j<=i;j++)
{
if(stu[j].per<large)
{
large=stu[j].per;
index=j;
denglish=stu[j].english;
}
else if(stu[i].per==large)
{
if(stu[j].english<dengli
sh)
{
large=stu[j].pe
r;
index=j;
dten=stu[j].ten
;
}
else if(stu[i].english==
denglish)
{
if(stu[j].ten<dt
en)
{
large=st
u[j].per;
index=j;
}
}
}
}
stu[index].per=stu[i].per;
stu[i].per=large;
strcpy(g,stu[i].name);
strcpy(stu[i].name,stu[index].name);
strcpy(stu[index].name,g);
tempid=stu[index].id;
stu[index].id=stu[i].id;
stu[i].id=tempid;
}
here2:
textcolor(9);
for(i=0;i<80;i++)
{
cprintf("-");
}
textcolor(4);
cout<<"MARIT NO."<<setw(25)<<"NAME"<<setw(35)<<"
PERCENTAGE"<<setw(7)<<"ID\n";
textcolor(9);
for(i=0;i<80;i++)
{
cprintf("-");
}
textcolor(4);
for(i=0;i<n;i++)
{ stu[i].maritno=i+1;
stu[i].display();
}
}
goto choise;
}
case 3:
{
clrscr();
while(tempno>0)
{
here1:
textcolor(1);
cprintf("for color");
clrscr();
cout<<"TOTAL SEAT="<<totalseat<<" TOTAL STUDEN
T="<<n<<" SEAT REMAINING="<<temptotalseat<<" STUDENT REMAINING="<<tempno;
for(i=0;i<noc;i++)
{
cout<<"\n\nSR. NO."<<setw(14)<<"NAME"<<s
etw(14)<<"BRANCH"<<setw(15)<<"SEAT";
for(j=0;j<coll[i].branch;j++)
{
cout<<"\n"<<setw(3)<<i+1<<" == "
<<setw(14)<<coll[i].collegename<<setw(3)<<setw(2)<<j+1<<"="<<setw(9)<<coll[i].br
anchname[j]<<setw(12)<<coll[i].seat[j]<<endl;
}
}
textcolor(4);
cout<<"\n";
cprintf("STUDENT INFORMATION");
cout<<"\nMARIT NO."<<setw(25)<<"NAME"<<setw(38)<
<"PERCENTAGE"<<setw(7)<<"ID\n";
stu[di].display();
if(temptotalseat==0)
{
cout<<"\n\n\t::::ALL SEAT ARE FULL:::::"
;
getch();
goto here33;
}
cout<<"\nENTER YOU CHOISE";
cout<<"\nENTER COLLEGE=";
cin>>college;
cout<<"ENTER BRANCH=";
cin>>branch;
if(college>noc||branch>(coll[college-1].branch))
{
cout<<"\n\n\t\t\t:::::::::::::ENTER VALI
D CHOISE::::::::";
getch();
goto here1;
}
int dd=check(coll[college-1].seat[branch-1]);
if(dd==0)
{
getch();
goto here1;
}
coll[college-1].seat[branch-1]--;
temptotalseat--;
tempno--;
strcpy(stu[di].college,coll[college-1].collegena
me);
strcpy(stu[di].branch,coll[college-1].branchname
[branch-1]);
gettime(&tt);
getdate(&d);
stu[di].hour=tt.ti_hour;
stu[di].min=tt.ti_min;
stu[di].sec=tt.ti_sec;
stu[di].y=d.da_year;
stu[di].dd=d.da_day;
stu[di].mon=d.da_mon;
di++;
getch();
}
here33:
file.seekg(0,ios::end);
for(int ii=0;ii<n;ii++)
{
file.write((char*)&stu[ii],sizeof(stu[ii]));
}
clrscr();
if(n==0)
{
cout<<"\n\n\n\n\n::::FIRST INPUT STUDENT ENTRY::
::\n\n\n\n\n\n";
}
else
here3:
clrscr();
{
cout<<"\nPRESS R FOR SHOW ADMISSION LIST";
}
cout<<"\n\n\nPRESS E FOR EXIT";
cout<<"\n\nPRESS M FOR MAIN MENU";
t=getch();
if(t=='m' || t=='M')
{
goto here;
}
if(t=='E' || t=='e')
{
goto exit;
}
if(t=='r' || t=='R')
{ if(n>0)
{
clrscr();
cout<<"\n\n\nMARIT NO."<<setw(11)<<"NAME
"<<setw(12)<<"percentage"<<setw(10)<<"college"<<setw(8)<<"branch"<<setw(6)<<"ID"
<<setw(8)<<"DATE"<<setw(13)<<"TIME\n";
for(int ii=0;ii<n;ii++)
{
stu[ii].display1();
}
cout<<"\n\n\nTOTAL SEAT="<<totalseat<<"
TOTAL STUDENT="<<n<<" SEAT REMAINING="<<temptotalseat<<" STUDENT REMAINING
="<<tempno;
}
getch();
goto here3;
}
if(t!='R' || t!='r' || t!='e' || t!='E'||t!='m' || t!='M
')
{
cout<<"\n\n\n\n\t\t:::::::PLEASE ENTER VALID CHO
ISE:::::::";
delay(1000);
goto here3;
}
}
case 4:
{
exit:
clrscr();
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
setcolor(RED);
setbkcolor(1);
settextjustify(CENTER_TEXT, CENTER_TEXT);
settextstyle(1,0,3);
outtextxy((getmaxx()/2-20),(getmaxy()/2-20),"TOTAL TIME
PROGRAMME USED");
char time1[25];
end=clock();
itoa((end - start) / CLK_TCK,time1,10);
settextstyle(1,0,2);
setcolor(10);
outtextxy((getmaxx()/2-60),(getmaxy()/2-20)+80,time1);
setcolor(4);
outtextxy((getmaxx()/2+30),(getmaxy()/2-20)+80,"SECOND")
;
getch();
exit(0);
}
case 5:
{
file.seekp(0,ios::beg);
cout<<"\n\n\nMARIT NO."<<setw(11)<<"NAME"<<setw(12)<<"pe
rcentage"<<setw(10)<<"college"<<setw(8)<<"branch"<<setw(6)<<"ID"<<setw(8)<<"DATE
"<<setw(13)<<"TIME\n";

while(file.read((char*)&stu[i],sizeof(stu[i])))
{
stu[i].display1();
}
file.close();
getch();
goto here;
}
case 6:
{
clrscr();
cout<<"ENTER ID FOR FINDING ADDMISSION DETAIL=";
int findid;
cin>>findid;
file.seekp(0,ios::beg);
while(file.read((char*)&stu[i],sizeof(stu[i])))
{
if(stu[i].id==findid)
{
cout<<"\n\n\n\n\n\nMARIT NO."<<setw(11)<<"NAME"<
<setw(12)<<"percentage"<<setw(10)<<"college"<<setw(8)<<"branch"<<setw(6)<<"ID"<<
setw(8)<<"DATE"<<setw(13)<<"TIME\n";
stu[i].display1();
getch();
file.close();
goto here;
}
}

cout<<"\n\n\n\n\n ID IS WRONG PLEASE ENTER VALI


D ID";
file.close();
getch();
goto here;
}
case 7:
{
graphics4();
goto here;
}
default:
{
cout<<"\n\n\n\n\n\n\n\n\n\t\t:::::::PLEASE ENTER VALID C
HOISE:::::::";
delay(1000);
clrscr();
goto here;
}
}
choise:
{
textcolor(10);
cprintf("\r\n");
for(i=0;i<80;i++)
{
cprintf("-");
}
cout<<"\n\n\n\n\n\n\t\t\t\t\t\t\tPRESS E FOR EXIT\n\t\t\t\t\t\t\
tPRESS M TO MAIN MENU ";
t=getch();
if(t=='m' || t=='M')
{
goto here;
}
if(t=='E' || t=='e')
{
goto exit;
}
if(t!='M' || t!='m' || t!='e' || t!='E')
{
cout<<"\n\n\n\n\t\t:::::::PLEASE ENTER VALID CHO
ISE:::::::";
delay(1000);
clrscr();
goto here;
}
}
}

Potrebbero piacerti anche