Code:
import java.util.*; //necessary for Scanner class
public class BarEntry2 {
	public static void main(String[] args){
		testTheAgeGivenTheYear() ; 
	}

public static void testTheAgeGivenTheYear() {
	Scanner console = new Scanner(System.in);
	console.nextLine();
	int currentYear = 2011;	
	int birthYear = console.nextInt() ;
	int age = currentYear - birthYear;
	int currentMonth = 7 ;
	boolean haveMorePatrons = true;
if (age >=21) {
	System.out.println("You may enter the bar!") ; }
else { 
	System.out.println("You may NOT enter the bar!") ; }
if (age =21) {
	System.out.println("Please enter the month you were born!") ; }
if (currentMonth >=8) {
	System.out.println("You may enter the bar!") ; }
	System.out.println("Do you want to test anymore patrons: (Y/N) ? ");
while (haveMorePatrons) {
	System.out.println("please enter your birth year: ") ; 
	System.out.println("You are " + age);
String ans = console.nextLine();
if (ans.equals("n") || ans.equals("N"))
	haveMorePatrons = false ;
	System.out.println ("Good Bye") ; }
}
}

Last edited by shabbir; 21Jul2011 at 09:40.. Reason: Code blocks