The Artima Developer Community
Sponsored Link

Java Answers Forum
help me analyze the error..pls

1 reply on 1 page. Most recent reply: Aug 1, 2008 5:26 AM by Stephen Morrow

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
yeye mancera

Posts: 1
Nickname: smile31
Registered: Jul, 2008

help me analyze the error..pls Posted: Jul 31, 2008 8:42 AM
Reply to this message Reply
Advertisement
hi..can you help me check my code?
am just wondering why i have these certain errors..
ERRORS:cannot find symbol method showMessageDialog(<nulltype>,java.lang.String,int) and cannot find symbol method egualsIgnoreCase(java.lang.String)

this is my code;


import javax.swing.*;
public class ManceraProject2{
public static void main(String[] args){
String prelimidterm[][]=new String[10][2];
String finalgrade[][]=new String[10][2];
String name[]=new String[10];
String wa="",pili,ngek;
double gr[]=new double[10];
int x,x1,x2;
String oc50="",oc61="",oc71="",oc81="",oc91="";
double average=0.0,addr=0.0;

do{
for(int i=0;i<10;i++){
name=JOptionPane.showInputDialog("Name of Student no. "+(i+1));
for(int j=0;j<2;j++){
do{
j=0;
prelimidterm[j]=JOptionPane.showInputDialog("Prelim Grade: ");
x=Integer.parseInt(prelimidterm[j]);
j++;
}while(x<50||x>100);
do{
j =1;
prelimidterm[j]=JOptionPane.showInputDialog("Midterm Grade: ");
x1=Integer.parseInt(prelimidterm[j]);
x=x+1;
j=0;
}while(x1<50||x1>1 00);
do{
finalgrade[j]=JOptionPane.showInputDialog("Final Grade: ");
x2=Integer.parseInt(finalgrade[j]);
average=(x+x1+x2)/3;
gr=average;
}whi le(x2<50||x2>100);
j++;
finalgrade[j]=Double.toString(average);
j=2;
}
JO ptionPane.showMessageDialog(null,name+" "+average,"Show Semester Grade",JOptionPane.INFORMATION_MESSAGE,null);
}

//---------SORTING---------
fo r(int i2=0;i2<10;i2++){
for(int j2=i2+1;j2<10;j2++){
if (gr[j2]>gr[i2]){
addr=gr[j2];
wa=name[j2];
gr[j2]=gr[i2];
name[j2]=name[i2];
gr[i2]=addr;
name[i2]=wa;
}
}
}
//------END OF SORTING--------

for(int exe=0;exe<10;exe++){
if(gr[exe]>=50&&gr[exe]<=60){
oc50+="*";
}
else if(gr[exe]>=61&&gr[exe]<=70){
oc61+="*";
}
else if(gr[exe]>=71&&gr[exe]<=80){
oc71+="*";
}
else if(gr[exe]>=81&&gr[exe]<=90){
oc81+="*";
}
else if(gr[exe]>=91&&gr[exe]<=100){
oc91+="*";
}
}
JOptionPane.showMes sageDialog(null,"Highest Scorer: "+name[0]+" "+gr[0]+"\n\n"+"Lowest Scorer: "+name[(name.length-1)]+" "+gr[(gr.length-1)]+"\n\n\nGRADE DISTRIBUTION\n\n"+"50-60:\t"+oc50+"\n\n\n"+"61-70:\t"+oc61+"\n\n\n"+"71-80:\t"+ oc71+"\n\n\n"+"81-90:\t"+oc81+"\n\n\n"+"91-100:\t"+oc91+"Highest/Lowest And Grade Distribution",JOptionPane.INFORMATION_MESSAGE,null);

pili=JOptionPane.showInpu tDialog("Do it Again?(y/n)");
}while(pili.egualsIgnoreCase("Y"));

//------------------------- ------------
}
}


Stephen Morrow

Posts: 5
Nickname: yawmark
Registered: Jan, 2007

Re: help me analyze the error..pls Posted: Aug 1, 2008 5:26 AM
Reply to this message Reply
You get a "cannot find symbol" message because the compiler doesn't recognize something you've typed. It's as if you instructed your friend to "fernt PL^%", to which s/he would likely reply, "Huh?". The compiler errors will tell exactly which symbols it does not recognize; correct these errors by properly defining variables, importing the correct classes, implementing the appropriate methods, using the appropriate constructors, etc.

In your case, it seems you are attempting to call a JOptionPane.showMessageDialog( that doesn't exist (check the way you call your method versus the available method signatures in the API), and trying to call an "egualsIgnoreCase()" method of String (note the simple typo of 'g' versus 'q').

~

Flat View: This topic has 1 reply on 1 page
Topic: JAVA Applets from Adobe Flash/MS Silverlight? Previous Topic   Next Topic Topic: DevWeek India 2008- No Marketing Bushwah, Only Real Information

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use