So i am sort of stuck with this one, due to the error when compiling, noted in the title. (for uni by the way)

But basically the idea is that if your aged between 5 and 18 you get the discount.
If your over 18 and below 60 and you have a concessionary ticket, you get the discount.
And if your under 5 or over 60 its free.

The problem is occurring on line 25, in bold below, just cant see what it is, im sure its pretty obvious, but if someone could point it out that would be great.

public class bluebus
{
	public static void main(String[]args)
	{
		double price = 10.75;
		double dis = 3.5;
		int free = 0;
		char ans;
		String name = getScannerInput.aString("What is your name? ");
		int age = getScannerInput.anInt("What age are you? ");
		
		
		{
		
		if ((age >=5) && (age <= 18))
		   {price = price - dis;
			System.out.println(name + " enjoy the ride!");
			System.out.println("The ticket price is: " + price);}	
					else
			if ((age < 5) || (age > 60))
			{	System.out.println(name + " enjoy the ride!");
				System.out.println("The ticket price is " + free);}
					else
	{	 ans = getScannerInput.aString("Do you have a concessionary ticket? Y for yes and N for no\t ").charAt(0);}				
				[B]if((age > 18) && (age<60) && (ans = 'y'))[/B]
				
						{	price = price-dis;
					System.out.println(name + " enjoy the ride!");
					System.out.println("The ticket price is: " + price);}									
							else
						{	price = price;
					System.out.println(name + "Sorry, you must pay the full fare!");
					System.out.println("The price of the ticket is: " + price);}				
																					
																			}
																
										
						}
	}

Edited 5 Years Ago by crazy8: n/a

This question has already been answered. Start a new discussion instead.