I was having a problem with this part of my code below:
Please Jump to Case 5 in the Main Switch Case not the Sub-Switch Case (USING NESTED SWITCH CASE) directly there is where I have made changes.
What I was trying to do was to display the showtimes only which were available for the day and not the others. No one can book a ticket of show time 9 am today at 2 pm. When I was trying to do this the program was not working according to me.
The Graphics got screwed and it is not "continuing" or breaking properly!
Please HELP! I know its a long code! Still in 11th Standard so need some help and advice!
Thank You!
EXCERPT FROM THE CODE:
cout<<"PLEASE SELECT YOUR THEATER (1/2/3/4/5):"<<"\n";
cin>>tc;//THEATER CODE
switch(tc)
{
case 1:
{
innovative();
data_innovative();
clrscr();
cleardevice();
setbkcolor(RED);
cout<<"THEATER YOU CHOSE: ";
cout.write(theater[1],40);
cout<<"\n\n\n\n\n\n";
setcolor(1);
settextstyle(3,0,5);
outtextxy(290,40," SHOW TIMES WITH COSTS");
cout<<"\t\tSILVER\t\tGOLD\n\n";
for(i=1;i<5;i++)//PRINTING SHOW TIMES
{
cout<<i<<".";
cout.write(st[i],38);
cout<<"\n\n";
}
clas=chclass();
cout<<"CHOOSE YOUR PREFERRED SHOW TIME (1/2/3/4) ";
cin>>stc;
switch(stc)
{
case 1:
cost+=c[1];
break;
case 2:
cost+=c[2];
break;
case 3:
cost+=c[3];
break;
case 4:
cost+=c[4];
break;
default:
error_scr();
goto retheatre;
}
break;
}
case 2:
{
inox_mantri();
data_inox_mantri();
clrscr();
cleardevice();
setbkcolor(RED);
cout<<"THEATER YOU CHOSE: ";
cout.write(theater[2],40);
cout<<"\n\n\n\n\n\n";
setcolor(1);
settextstyle(3,0,5);
outtextxy(290,40," SHOW TIMES WITH COSTS");
cout<<"\t\tSILVER\t\tGOLD\n\n";
for(i=1;i<5;i++)//PRINTING SHOW TIMES
{
cout<<i<<".";
cout.write(st[i],38);
cout<<"\n\n";
}
clas=chclass();
cout<<"CHOOSE YOUR PREFERRED SHOW TIME (1/2/3/4) ";
cin>>stc;
switch(stc)
{
case 1:
cost+=c[1];
break;
case 2:
cost+=c[2];
break;
case 3:
cost+=c[3];
break;
case 4:
cost+=c[4];
break;
default:
error_scr();
goto retheatre;
}
break;
}
case 3:
{
famelido();
data_famelido();
clrscr();
cleardevice();
setbkcolor(RED);
cout<<"THEATER YOU CHOSE: ";
cout.write(theater[3],40);
cout<<"\n\n\n\n\n\n";
setcolor(1);
settextstyle(3,0,5);
outtextxy(290,40," SHOW TIMES WITH COSTS");
cout<<"\t\tSILVER\t\tGOLD\n\n";
for(i=1;i<5;i++)//PRINTING SHOW TIMES
{
cout<<i<<".";
cout.write(st[i],38);
cout<<"\n\n";
}
clas=chclass();
cout<<"CHOOSE YOUR PREFERRED SHOW TIME (1/2/3/4) ";
cin>>stc;
switch(stc)
{
case 1:
cost+=c[1];
break;
case 2:
cost+=c[2];
break;
case 3:
cost+=c[3];
break;
case 4:
cost+=c[4];
break;
default:
error_scr();
goto retheatre;
}
break;
}
case 4:
{
inox();
data_inox();
clrscr();
cleardevice();
setbkcolor(RED);
cout<<"THEATER YOU CHOSE: ";
cout.write(theater[4],40);
cout<<"\n\n\n\n\n\n";
setcolor(1);
settextstyle(3,0,5);
outtextxy(290,40," SHOW TIMES WITH COSTS");
cout<<"\t\tSILVER\t\tGOLD\n\n";
for(i=1;i<5;i++)//PRINTING SHOW TIMES
{
cout<<i<<".";
cout.write(st[i],38);
cout<<"\n\n";
}
clas=chclass();
cout<<"CHOOSE YOUR PREFERRED SHOW TIME (1/2/3/4) ";
cin>>stc;
switch(stc)
{
case 1:
cost+=c[1];
break;
case 2:
cost+=c[2];
break;
case 3:
cost+=c[3];
break;
case 4:
cost+=c[4];
break;
default:
error_scr();
goto retheatre;
}
break;
}
case 5:
{
pvr();
data_pvr();
clrscr();
cleardevice();
setbkcolor(4);
cout<<"THEATER YOU CHOSE: ";
cout.write(theater[5],40);
cout<<"\n\n\n\n\n\n";
setcolor(1);
settextstyle(3,0,5);
outtextxy(290,40," SHOW TIMES WITH COSTS");
cout<<"\t\tSILVER\t\tGOLD\n\n";
for(i=1;i<5;i++)//PRINTING SHOW TIMES
{
switch(i)
{
case 1:
{
currenttime();//A FUNCTION I MADE
if((hour>9) && ((hour==9) && (min>=20)) && (i==1))
continue;
cout<<i<<".";
cout.write(st[i],38);
cout<<"\n\n";
break;
}
case 2:
{
currenttime();//A FUNCTION I MADE
if((hour>12) && ((hour==12) && (min>=30)) && (i==2))
continue;