another "cannot find symbol" error :(
i'm new to programming, and i'm currently trying to make a program that can calculate the area of a pentagon...
right now i'm debugging the code online, since i do not have a program installed on this computer. Anyways, i get this error on line 17...can anybody tell me how to fix it and what it is?
AreaPentagon.java:17: cannot find symbol symbol : variable dataIn location: class AreaPentagon side = dataIn.readLine(); ^ 1 error
import javax.swing.JOptionPane;
publicclass AreaPentagon
{
publicstaticvoid main(String[] args)
{
//declare and construct variables
double side;
double pentagonArea;
double strSide;
//print promts and get input
System.out.println("Area of a Regular Pentagon");
System.out.println("What is the length of a side on the Pentagon");
side = dataIn.readLine();
//calculations
pentagonArea = 1.720477 * Math.pow(side,2);
//output
System.out.print("The Area is: " + pentagonArea);
}
}
[1648 byte] By [
jvhuggarda] at [2007-11-27 8:12:17]

hey jv,
try to learn how the error is printed...
[File Name]:[Line Number]: [Error Description]
AreaPentagon.java:17: cannot find symbol
and after that for this error...
[What is not found?]: [What is it?] [By what name is it calling?]: location: [Type] [Class Name]
symbol : variable dataIn location: class AreaPentagon
and then the line where the error is happening...
side = dataIn.readLine(); ^ 1 error
now you try to tell me why the error is happing...
regards
i_virus
ok...it took me about 2 minute but i finally understand what your saying
AreaPentagon.java:17: cannot find symbol
symbol : variable dataIn
location: class AreaPentagon side = dataIn.readLine(); ^ 1 error
i understand the first line....java is saying a symbol is not found and that symbol is a variable and the name of the symbol/variable is dataIn
i did a little bit more research based off what david was saying, and it appears i didn't declare the variable. i figured out, thats because i was going off a previous code and i imported a package i wasnt using ("javax.swing.JOptionPane" instead of "java.io.*")
thank you both for the help!