Professional Documents
Culture Documents
Title Reservation (Mini Project) Author Mubasher Afzal Author Email
Title Reservation (Mini Project) Author Mubasher Afzal Author Email
//Mubasher Afzal
//mubasherafzal@yahoo.com
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
"+
"+
System",JOptionPane.INFORMATION_MESSAGE);
int choice=Integer.parseInt(ch);
int i=0,j=0;
while(choice !=4)
switch(choice)
case 1:
if(i>4 ){
JOptionPane.showMessageDialog(null,"All seats
are book in
smoking
section
"+
break;}
smoking(i);
i++;
break;
case 2:
if(j>4){
JOptionPane.showMessageDialog(null,"All seats
are book in
nonsmoking section
"+
break;}
nons(j);
j++;
break;
case 3:
status();
break;
default:
choice
"+"enter
again");
ch=JOptionPane.showInputDialog("Enter a choice");
choice=Integer.parseInt(ch);
System.exit(0);
}
public static void smoking(int x)
/* if(x>4){
break;
}*/
smoking[x]=1;
"
seat no--"+x+"
Smoking section";
JOptionPane.showMessageDialog(null,output,"Boarding
Pass",JOptionPane.INFORMATION_MESSAGE);
nons[y]=1;
seat no--"+y+"
NonSmoking section";
JOptionPane.showMessageDialog(null,output,"Boarding
Pass",JOptionPane.INFORMATION_MESSAGE);
int t;
outputArea.append("Smoking nonSmoking
");
for( t=0;t<5;t++)
outputArea.append(smoking[t]+" "+nons[t]+"
");
JOptionPane.showMessageDialog(null,outputArea,"seat
info",JOptionPane.INFORMATION_MESSAGE);