I need to write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. Im getting a couple errors can anyone help me out?
First and foremost, you'll want to have a look at our FAQ on how to ask questions at JavaRanch as it will greatly help you to get decent answers, including how to use code tags at JavaRanch. You'll also want to post full error messages if you have any and indicate the line number causing the error.
Next as to one of your problems, your class name is two words, NewClass CalculatingTipsUseingInputDialog, where only one is allowed.
It's line 28 in the code you posted. It's because JOptionPane.showMessageDialog(null,output); returns void. And that is not allowed to concatenate with a String.
You probably meant:
Oh ok I see what i did wrong there thanks Wouter. As far as my class name being two words I am not sure what you mean. I am sorry for the simple questions I am very new to java.
Well the name of your class is "NewClass CalculatingTipsUsingInputDialog" which are 2 words which is not allowed. It can only be one word. So I assume you want it to be just "CalculatingTipsUsingInputDialog".
ok when I change my class name to that I now get the error class "CalculatingTipsUsingInputDialog is public, should be declared in a file named CalculatingTipsUsingInputDialog.java"
OK I found the problem I had the class name as New Class.java I changed it to CalculatingTipsUsingInputDialog.java and everything runs fine. Thank you everyone for your help.