You still don't assing a value to them
JOptionPanes return String
so you'll have to to something like that and then A and B will be initialized
CODE
x=JOptionPane.showInputDialog(null,
"Enter Subtotal","VALUE FOR A",
JOptionPane.QUESTION_MESSAGE);
a = Integer.parseInt(x);
x=JOptionPane.showInputDialog(null,
"Enter Gratuiuty Rate","VALUE FOR B",
JOptionPane.QUESTION_MESSAGE);
b = Integer.parseInt(x);
QUOTE(vik09 @ 15 Sep, 2008 - 01:21 PM)

When you declare a variable give it a value.
So... give your variables some values like
CODE
int a = 0;
Do this with all your variables ints, double, String.
Do what you want but this is NOT a good idea...
Take the last example, if Porknbeans would have to that he would never had the error message saying that A and B wher not initialized and he may have look for hours why the values of A and B were 0.
By declaring your variables without initializing them, you will receice computer warning telling you "you hava a logic problem ! Why do you declare variable if you never use them ?"