You are on page 1of 12

#

#
#
#
#
#
#

include
include
include
include
include
include
include

<fstream.h>
<conio.h>
<dos.h>
<process.h>
<stdio.h>
<graphics.h>
<string.h>

void graph()
{
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi");
}
int xco,yco;
char str[30];
void setposition(int x, int y)
{
xco=x; yco=y;
}

void settext(char s[])
{
strcpy(str, s);
}
struct cast
{
char
char
char
char
};

n_a[40];
n_ac[40];
n_d[40];
n_o[100];

class hall
{
protected:
cast c;
float t;
char grade[2];
public:
char name[100];
void input();
void display();
void f_display();
};
void hall::input()
{
cout<<"ENTER THE NAME OF THE FILM:";
gets(name);
cout<<"ENTER ACTOR NAME:";
gets(c.n_a);
cout<<"ENTER ACTRESS NAME:";
gets(c.n_ac);
cout<<"ENTER DIRECTOR NAME:";
gets(c.n_d);
cout<<"ENTER OTHERS:";

n_o). settextstyle(style.s). moveto(xco. graph(). puts(c. cleardevice(). setposition(0.size).-10.st=TRIPLEX_FONT. cout<<"ENTER THE TIME LIMIT OF FILM:". puts(c. } void hall::f_display() { clrscr().yco). //setbkcolor(BLUE).n_a). setposition(0. setcolor(RED). cout<<"ACTRESS NAME :\t\t\t". bar3d(425. settext("COMPLEX").HORIZ_DIR.1). settext(name). puts(name).HORIZ_DIR. int s=4. cout<<"TIME LIMIT OF FILM :\t\t".n_ac). moveto(xco. } void hall::display() { clrscr(). cout<<"\n\t*******".yco). cout<<"GRADE GIVEN(BY CENSOR BOARD) :\t". puts(grade). settext("CINEMA").size). outtext(str).gets(c.500.HORIZ_DIR. cout<<"\nACTOR NAME :\t\t\t".700. int size=8.n_o). settextstyle(st. settextstyle(style. cout<<"DIRECTOR NAME :\t\t\t". cout<<t. cout<<"\n\tCASTING". setfillstyle(4. puts(c. gets(grade). cout<<"OTHERS :\t\t\t".300).22).RED).yco).1.122). . graph(). setcolor(4). outtext(str). puts(c. cout<<"ENTER THE GRADE GIVEN TO FILM BY CENSOR BOARD:". cin>>t. setcolor(BLUE). cout<<"\n\t*******".style=GOTHIC_FONT. moveto(xco. outtext(str).n_d). setposition(0.

500.i<=330. void seats::reserve(int num) { graph(). s=num.-10.1).k+=70) { w+=1.1). cleardevice(). } } int s=0.-10. bar3d(435.BLUE). int w=0. } setcolor(2).l.10).500. void l_reserve(int num).k.l=55. for(j=40. setcolor(8).700. void u_reserve(int num).i<=330.1. } class seats:public hall { public: int bal.500.700. gotoxy(55.n.m.l<=465. seats() { bal=lower=upper=0.700.l=55.j<=450.1.l.1.-10.700.-10.-10. void l_cancel(int num).j=40.i+=70.1). for(j=40.k+=70) { bar3d(i.j.1.k.1. int lower.1.k<=400.j+=30. bar3d(450. if(w>=s+1) { break. setfillstyle(8. int upper.k<=400.1.j. . bar3d(440.1).k=100.-10.l=55. int i. } void b_reserve(int num).700.1).500.l+=30) { for(i=50. ~seats() { } }. void u_cancel(int num).j<=450.j+=30.k=100.bar3d(430.1).500.500.l<=465. bar3d(425.l+=30) { for(i=50. i=50.700.k=100.1). void b_cancel(int num).i+=70. bar3d(445. void reserve(int num).

1. cout<<" COMPLETED". closegraph(). cout<<" RESERVATION". cout<<" CANNOT". gotoxy(55. closegraph(). gotoxy(55. bar3d(i. cout<<" COMPLETED". clrscr(). cout<<"***************". } else { clrscr(). cout<<" RESERVATION". cout<<"***************". getch().l.setfillstyle(2. if((bal+num)<=70) { bal+=num. gotoxy(55.12). closegraph().11). cout<<"***************"."<<num*120. } } } void seats::b_reserve(int num) { reserve(bal). getch(). cout<<"AMOUNT TO BE PAID".11). } void seats::u_reserve(int num) { reserve(upper).17).k. gotoxy(55.10). gotoxy(56.j. reserve(upper).12).10). gotoxy(55. cout<<" RESERVE". cout<<"***************". if((upper+num)<=70) { upper+=num. . gotoxy(55. cout<<"Rs. gotoxy(55. gotoxy(55.12).2).11).16).1). reserve(bal). gotoxy(55.13). reserve(bal). } closegraph().13). clrscr(). gotoxy(55. gotoxy(55.

} closegraph(). reserve(lower). closegraph(). cout<<"***************". if((lower+num)<=70) { lower+=num.16). clrscr(). gotoxy(55. gotoxy(55. gotoxy(55. } void seats::l_reserve(int num) { reserve(lower). cout<<"Rs. gotoxy(55. getch().11). cout<<" RESERVATION". getch(). cout<<"AMOUNT TO BE PAID". cout<<"Rs.11). getch(). gotoxy(55."<<num*20. } closegraph(). getch(). cout<<"AMOUNT TO BE PAID".17). reserve(lower).gotoxy(55. gotoxy(55. cout<<" CANNOT".16). cout<<" RESERVE".12). closegraph().10).12). gotoxy(55. cout<<"***************".12). cout<<" CANNOT". reserve(upper).13). closegraph().11). cout<<" COMPLETED". } . } else { clrscr(). cout<<" RESERVE". gotoxy(55. } else { clrscr(). gotoxy(55. gotoxy(56. gotoxy(56.17)."<<num*80.

getch(). cout<<"***************". gotoxy(55.10). cout<<"TICKET AMOUNT ".17). getch(). gotoxy(55. gotoxy(56.16). cout<<" COMPLETED". cout<<" COMPLETED". closegraph(). } closegraph().void seats::b_cancel(int num) { reserve(bal). gotoxy(55. cout<<" CANCELATION". clrscr(). gotoxy(55. gotoxy(55. getch(). cout<<" CANNOT". if((lower-num)>=0) { lower-=num."<<num*80. gotoxy(55.11). cout<<" CANCELATION". reserve(bal). reserve(lower). reserve(bal). gotoxy(55. cout<<"Rs. gotoxy(55. closegraph(). gotoxy(55. clrscr(). } else { clrscr().11). } void seats::l_cancel(int num) { reserve(lower). cout<<"***************".11). if((bal-num)>=0) { bal-=num. closegraph().12). gotoxy(55.12).13). cout<<"***************". cout<<"***************". cout<<"TICKET AMOUNT ".16). cout<<"Rs. cout<<" CANCEL".12). } . gotoxy(55.13). gotoxy(56."<<num*120.10). gotoxy(55.17).

cout<<" CANCELATION".num. int ch. closegraph(). gotoxy(55. } else { clrscr(). if((upper-num)>=0) { upper-=num.c. .10). cout<<" CANCEL". getch(). seats s. clrscr(). gotoxy(55. reserve(lower). } closegraph(). closegraph(). gotoxy(55. cout<<" COMPLETED". } void main() { clrscr().11). hall h1. getch(). char d. gotoxy(55. gotoxy(55. cout<<"***************". reserve(upper).12)."<<num*20. gotoxy(56.16). cout<<"TICKET AMOUNT ".13). reserve(upper).else { clrscr().e. gotoxy(55. cout<<" CANNOT". gotoxy(55. gotoxy(55. } void seats::u_cancel(int num) { reserve(upper). cout<<"***************".17).12). getch().11). gotoxy(55. cout<<" CANNOT". cout<<" CANCEL". } closegraph(). cout<<"Rs.12).11). closegraph().

s.16). cout<<"4)AMOUNT COLLECTED".10). cout<<"MAIN MENU". cout<<"*********".15).char h. cout<<"1)CHANGE FILM". gotoxy(58. s. . s. gotoxy(58. fstream f.11).18). cout<<"ENTER CHOICE:".f_display(). s. cout<<"ANY OTHER TO QUIT". h='y'. gotoxy(58. switch(ch) { case 1: { closegraph(). cin>>c. ch=1. gotoxy(58.15).sizeof(hall)). f. cout<<"2)DISPLAY FILM".close().input(). cout<<"2)RESERVATION". cout<<"1)ABOUT FILM". } switch(c) { case 1: closegraph().write((char*)&s. gotoxy(58.14).input(). cout<<"FILM MENU". f. cout<<"ANY OTHER TO RETURN". cout<<"3)CANCELLATION". while(ch==1||ch==2||ch==3||ch==4||ch==5) { clrscr(). gotoxy(58. gotoxy(58. cout<<"*********".dat".13).11). gotoxy(58. gotoxy(58.open("cinema. clrscr(). gotoxy(58.ios::in|ios::out|ios::app|ios::binary). gotoxy(58. break. f.17). f.close().13). cin>>ch.10).19).11).display(). cout<<"ENTER CHOICE:". gotoxy(58. gotoxy(58. closegraph(). gotoxy(58.

s. s. clrscr(). } break. switch(d). //f1. gotoxy(58. cout<<"RESERVATION". cout<<"RESERVE MORE(Y/N):".14).17). gotoxy(58.18).reserve(s. case '2': h='y'.close().read((char*)&s. s.f_display(). s. //f1. while(d==1||d==2||d==3) { closegraph(). break.bal). gotoxy(58. cout<<"1)FOR BALCONY".b_reserve(num). closegraph().bal). gotoxy(58.11). f. cout<<"3)FOR LOWERSTALL".case 2: clrscr(). gotoxy(58. gotoxy(58.sizeof(hall)). gotoxy(58. case 3: break. cin>>d. case 2: d=1. cin>>h. cout<<"*************".16).read((char*)&s.13). while(h=='y'||h=='Y') . closegraph(). } closegraph().sizeof(seat s)). gotoxy(58. cout<<"ANY OTHER TO RETURN". f. getch().sizeof(seat s)).10). s. { case '1':h='y'. cin>>num. cout<<"ENTER CHOICE:".reserve(s. cout<<"HOW MANY:".display(). gotoxy(58.read((char*)&s. while(h=='y'||h=='Y') { clrscr(). break.15). clrscr().16). cout<<"2)FOR UPPERSTALL".

gotoxy(58.16). cout<<"*************". cout<<"RESERVE MORE(Y/N):". s. cin>>num. cout<<"1)FOR BALCONY".14). closegraph(). clrscr(). gotoxy(58. s. gotoxy(58.reserve(s. } closegraph().read((char*)&s. s. closegraph(). cout<<"HOW MANY:".{ clrscr(). cout<<"2)FOR UPPERSTALL". clrscr(). clrscr().16). gotoxy(58. cout<<"HOW MANY:".sizeof(seat s)). case 3 : e=1. s. while(h=='y'||h=='Y') { clrscr(). gotoxy(58.15).lower). break. //f1. //f1.10). s.13).upper).11). cin>>h.upper). } closegraph().reserve(s. gotoxy(58.sizeof(seat s)).f_display().lower). gotoxy(58. .reserve(s.reserve(s. } } break. cin>>num.l_reserve(num). cout<<"CANCELLATION". s. s. cout<<"RESERVE MORE(Y/N):". break. cin>>h.18).read((char*)&s.18). gotoxy(58. case '3': h='y'. while(e==1||e==2||e==3) { closegraph().u_reserve(num). gotoxy(58.

read((char*)&s.cout<<"3)FOR LOWERSTALL". closegraph(). //f1. gotoxy(58.16). //f1.16).read((char*)&s.18). s.read((char*)&s.17). s. } closegraph(). s. break.upper). cout<<"ANY OTHYER TO RETURN". gotoxy(58. cin>>m.reserve(s.reserve(s.upper). cin>>m. closegraph(). cout<<"CANCEL MORE(Y/N):". while(m=='y'||m=='Y') { clrscr().read((char*)&s. cin>>num.reserve(s. s. cout<<"HOW MANY:". clrscr(). char m. //f1. cout<<"ENTER CHOICE:".bal). case '3': m='y'. //f1. while(m=='y'||m=='Y') { clrscr(). gotoxy(58. cin>>num. cout<<"HOW MANY:". cout<<"CANCEL MORE(Y/N):".u_cancel(num). cin>>e. case '2': m='y'. gotoxy(58. } closegraph(). break. closegraph().sizeof(seat s)).16). s. gotoxy(58. while(m=='y'||m=='Y') { clrscr().sizeof(seat s)). gotoxy(58.bal). clrscr().b_cancel(num).18). . s.sizeof(seat s)).sizeof(seat s)). switch(e) { case '1': m='y'.reserve(s.

bal*120)+(s.reserve(s. //f1. cout<<"HOW MANY:". cin>>m.lower). } . cout<<"CANCEL MORE(Y/N):". gotoxy(58.//f1.reserve(s. } closegraph(). getch(). cin>>num. gotoxy(58. s. clrscr(). break.l_cancel(num).read((char*)&s. closegraph().lower).upper*80)+(s.12). clrscr().lower*20).sizeof(seat s)). s. } } getch(). s. clrscr(). cout<<(s. gotoxy(58.sizeof(seat s)).18). case 4: closegraph(). s. closegraph(). break.16). } } break.f_display(). gotoxy(58. cout<<"AMOUNT COLECTED:".10).read((char*)&s.