cannot find symbol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • parasnshah
    New Member
    • Apr 2007
    • 2

    #1

    cannot find symbol

    Hii guys,

    I am just a begineer and need help on this error

    ERROR:

    symbol : method showMessageDial og(<nulltype>,j ava.lang.String ,double,java.la ng.String,int)
    location: class javax.swing.JOp tionPane
    JOptionPane.sho wMessageDialog( null,"Average of five number",+averag e,"Class Average",JOptio nPane.INFORMATI ON_MESSAGE);

    SOURCE:

    public class Average
    {

    public static void main( String args[])
    {
    int sum;
    int average;
    int counter;
    int grade;

    String number;

    counter = 1;
    sum = 0;

    while (counter<=5)
    {
    number = JOptionPane.sho wInputDialog("E nter the number");

    grade = Integer.parseIn t(number);

    sum = sum + grade;
    }

    counter++;

    average = sum/5;

    JOptionPane.sho wMessageDialog( null,"Average of five number",+averag e,"Class Average",JOptio nPane.INFORMATI ON_MESSAGE);

    System.exit(0);
    }

    }


    Thanks a ton in advance
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by parasnshah
    Code:
    JOptionPane.showMessageDialog(null,"Average of five number",+average,"Class Average",JOptionPane.INFORMATION_MESSAGE);
    Have a close look at that comma just before the +average thing. My guess is
    that it shouldn't be there.

    kind regards,

    Jos

    Comment

    • parasnshah
      New Member
      • Apr 2007
      • 2

      #3
      Thanks a ton dude, it really worked

      Comment

      • weirdalduke
        New Member
        • Sep 2007
        • 1

        #4
        Yo! I had the same type of problem, found this and DONE! Thanks so much.

        Comment

        Working...