Stuck on Boolean varification--plz help

Hi there,

I'm very new to Java, and I'm trying to find a solution.

I have the user inputting a 6 digit number

the last digit is dropped and the 5 digit number is then % 7

to achive a remainder.

The remainder and the dropped digit should be the same, if so..a boolean "true" would then be displayed, or false if not.

EX. 123454

drop the 4

12345 % 7 = 4

dropped digit 4 - remainder is 4 so boolean returns true.

I have everything except the boolean part.

Any help/explanation would be very helpfull.

Thank you in advance

Cutter

CODE:

import javax.swing.JOptionPane;

public class TicketNumber

{

public static void main(String[] args)

{

String ticketString;

int ticket,valid,lastDigit,isTicketVaild;

int result = 7;

ticketString = JOptionPane.showInputDialog(null, "Enter 6 digit ticket number" , "Ticket validation",

JOptionPane.INFORMATION_MESSAGE);

lastDigit = Integer.parseInt(ticketString) -1;

valid = Integer.parseInt(ticketString) % result;

boolean b;

b=false

if(lastDigit==valid)b=true;

JOptionPane.showMessageDialog(null, b);

System.exit(0);

}

}