I have worked the the password issue but I want the program to recognize if the user has said Return or single and then deduct it from his credit, is there anyway that some one can help me, thank you.
GreenfootImage textImage1 = new GreenfootImage("PAY FOR TICKET HERE",25, Color.BLACK, Color.WHITE);
setImage(textImage1);
String password="busman";
String passcode=password;
String code=password;
int credit=30;
int Return=5;
int Single=3;
if(Greenfoot.mouseClicked(this))
{
String Passcode = JOptionPane.showInputDialog("what is your password");
if(password==password)
{
System.out.println("accepted");
}
}
if(Greenfoot.mouseClicked(this))
{
String rors = JOptionPane.showInputDialog("Return or Single");
if (rors==""+Return)
{
System.out.println(credit-Return );
}
}
