Salon membership fee Male = 600 Female = 500
If Foreigner +850
n for not foreign
f if foreign
my code is

public static void main(String[] args)
{
String gender, nat;

gender=JOptionPane.showInputDialog("Gender");
nat=JOptionPane.showInputDialog("Nationality");

if (gender=="m" & nat=="n"){
JOptionPane.showMessageDialog(null,"Gender:" +gender +"\nNationality"+nat+"Fee is 1450"

This code doesn't work so I don't really know other solutions.

public static void main(String[] args)
{
String gender, nat;

gender=JOptionPane.showInputDialog("Gender");
nat=JOptionPane.showInputDialog("Nationality");

if (gender.equals("m") & nat.equals("n")){
JOptionPane.showMessageDialog(null,"Gender: " +gender +"\n Nationality: "+nat+" Fee is 1450");

}

- i hope this will help
you should the difference between this two things

if (name == "Mickey Mouse")   // Legal, but ALMOST SURELY WRONG
if (name.equals("Mickey Mouse"))  // Compares values, not refererences.

see this tutorial :
1-http://leepoint.net/notes-java/data/expressions/22compareobjects.html

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