Hi i really need help with my java program it keeps saying i need to have a while statement at the end and i have no idea why if anyone could help it would be greatly appreciated
/**
* Write a description of class Cinema here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Cinema
{
public static void main (String args[]) throws Exception
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
String title ="*******************Welcome To Cinema Enterpriso************";
String list[]=new String[20];//This is where I store my movie names.
list[0]="Iron Man 3";
list[1]="Spawn";
list[2]="Man of Steel";
list[3]="Titanic";
list[4]="Avatar";
list[5]="Thor 2";
list[6]="Mamma Mia!";
list[7]="The Hobbit Part 2";
list[8]="Batman";
list[9]="Superman";
String city [] = new String[10];//This section is used for storing the locations of the cinemas.
city[0]="Leeds";
city[1]="Manchester";
city[2]="London";
city[3]="Bradford";
city[4]="Birmingham";
String cityN, movie, size;
String ans="Q";
String ans1="Q";
int flag=0, flag1=0, flag2=0, flag3=0, flag4=0, quantity, date, drink, tot_drink, snack, tot_snack, fd;
int tot_fd=1, tot_d,d,ch;
do
{
System.out.println();
System.out.println(title);
System.out.println("****************************** ************************");
System.out.println();
System.out.println("<<<<< Select The Location Of Your Cinema >>>>>");
do
{
if(flag>0)
System.out.println("**Invalid input please try again**");
System.out.println("****************************** *****************");
System.out.println("** Leeds, Manchester, London, Bradford, Birmingham **");
System.out.println();
System.out.print("Enter the correct name for the city of your choice :");
cityN=br.readline();
for(int i=0;i<5;i++)
{
if (city[i].equalsIgnoreCase(cityN))
{
flag=0;
break;
}
else
flag++;
}
}while (flag1!=0);
System.out.println(title);
System.out.println("****************************** **************************");
System.out.println("\f");
System.out.println(title);
System.out.println("****************************** ***************************");
System.out.println("<<<Select which date you wish to see the movie >>>");
do
{
System.out.println("****************************** *********************");
System.out.println("** 1. Monday, 1 April [2013] **");
System.out.println("** 2. Tuesday, 2 April [2013] **");
System.out.println("** 3. Wednesday, 3 April [2013] **");
System.out.println("** 4. Thursday, 4 April [2013] **");
System.out.println("** 5. Friday, 5 April [2013] **");
System.out.println("** 6. Saturday, 6 April [2013] **");
System.out.println("** 7. Sunday, 7 April [2013] **");
System.out.println();
System.out.print("Enter the correct number for the date you wish to see the movie :");
date=Integer.parseInt(br.readline());
if((date>=1)&&(date<=7))
flag2=0;
else
{
System.out.println("*** Invalid input please try again ***");
flag2++;
}while(flag2!=0);
System.out.println("\f");
System.out.println(title);
System.out.println("****************************** ********************");
System.out.println("<<< Please enter the number of tickets >>>");
System.out.println("****************************** ********************");
System.out.print("Enter the number of tickets :");
quantity=Integer.parseInt(br.readLine());
System.out.println("****************************** *********************");
System.out.println("\f");
System.out.println(title);
System.out.println("****************************** *********************");
{
System.out.println("<<< Movie Selection >>>");
do
{
if (flag3>0)
System.out.println("*** Invalid input please try again ***");
System.out.println("****************************** **************** Now Showing ************************************************** ******");
System.out.println("Movie name Rating Price Seats A/V");
System.out.println();
System.out.println("Iron Man 3 12 £5.00 200");
System.out.println("Spawn 15 £5.00 50");
System.out.println("Man of Steel 12 £5.00 200");
System.out.println("Titanic 12 £5.00 50");
System.out.println("Avatar 12 £5.00 50");
System.out.println("Thor 2 12 £5.00 200");
System.out.println("Mamma Mia! PG £5.00 50");
System.out.println("The Hobbit Part 2 12 £5.00 200");
System.out.println("Batman 15 £5.00 50");
System.out.println("Superman U £5.00 50");
System.out.println();
System.out.print("Enter the name of your selected movie :");
movie=br.readline();
for (int i=0;i<10;i++)
{
if(list[i].equalsIgnoreCase(movie))
{
flag3=0;
break;
}
else
flag3++;
}
}while (flag3!=0);
System.out.println();
System.out.println("<<< Please collect your bill >>>");
System.out.println("****************************** ***********************");
System.out.println("Movie Selected :"+movie);
System.out.println("The total cost is £"+(quantity*5));
System.out.print("Your seats numers are ");
for (int i=1;i<=quantity;i++)
{
System.out.print(135+i+" ");
}
System.out.println();
}
System.out.println("****************************** ***************************");
System.out.println("************** Thank You For Buying Tickets *************");
System.out.println();
System.out.println("****************************** ***************************");
System.out.println("To quit buying tickets enter 'Q' ");
ans=br.readline();
System.out.println("\f");
System.out.println(title);
System.out.println("****************************** ***************************");
do
{
System.out.println("*************Cinema Enterpriso Snack Bar*************");
System.out.println();
System.out.println("***************** Section : Beverages ***************");
System.out.println("***************** All Beverage £2.00 ****************");
System.out.println("1. Coca Cola 2. Tango");
System.out.println("3. Fanta 4. Dr Pepper");
System.out.println("5. Sprite 6. Coke Zero");
System.out.println();
String flagC1=new String();
System.out.print("Do you want to buy anything here? (Y/N):");
flagC1=br.readLine();
System.out.println();
if (flagC1.equalsIgnoreCase("Y"))
{
System.out.print("Choose your beverage by entering the number :");
bvrg=Integer.parseInt(br.readline());
System.out.print("Enter the total number of beverage you want to buy :");
tot_bvrg=Integer.parseInt(br.readline());
System.out.println("****************************** *******************");
System.out.println();
System.out.println("<<< Section 1 Bill >>>");
System.out.println("****************************** *******************");
if(bvrg>1 && bvrg <=6)
System.out.println("The total cost is £"+(tot_bvrg*2));
System.out.println();
}
else
System.out.println();
System.out.println("****************************** ***********************");
System.out.println("**************** Section : Snacks *******************");
System.out.println();
System.out.println();
System.out.println("7. Pop Corn [Small] £2.00 8. Pop Corn [Reg] £3.00");
System.out.println("9. Pop Corn [Large] £4.00 9. Pop Corn [XL] £5.00");
String flagC2=new String();
System.out.println();
System.out.print("Do you want anything here? (Y/N):");
flagC2=br.readLine();
System.out.println();
if(flagC2.equalsIgnoreCase("Y"))
{
System.out.println("Choose your snack by entering the number");
snck=Integer.parseInt(br.readLine());
System.out.println();
System.out.println("Enter the number of snacks you want to buy");
tot_snck=Integer.parseInt(br.readLine());
System.out.println("****************************** ******************");
System.out.println();
System.out.println("<<< Section 2 Bill >>>");
System.out.println("****************************** ******************");
if(snck=7)
System.out.println("Total cost is £"+(tot_snck*2));
else if(snck=8)
System.out.println("Total cost is £"+(tot_snck*3));
else if(snck=9)
System.out.println("Total cost is £"+(tot_snck*4));
else if(snck=9)
System.out.println("Total cost is £"+(tot_snck*5));
}
else
System.out.prinln();
System.out.println("To quit buying food enter 'Q'");
ans1=br.readLine();
}while((ans1.equalsIgnoreCase("Q"))!=true);
}
}
}