dantheman88
November 7th, 2006, 05:04 PM
I've written a test app to check a class but the app compiles with this error:
and I can't figure out how to fix it. I'm thinking it has something to do with my array setup. Anyone have any ideas? I'd really appreciate it
Test.java:5: cannot find symbol
symbol : variable A_call
location: class Test
A_call.Alist = new A_call();
^
Test.java:5: cannot find symbol
symbol : class A_call
location: class Test
A_call.Alist = new A_call();
^
Test.java:6: cannot find symbol
symbol : variable Alist
location: class Test
double a_value = Alist[100];
Here's the test code:
public class Test
{
public static void main (String [] args)
{
A_call.Alist = new A_call();
double a_value = Alist[100];
System.out.println(+a_value);
}
}
and the class itself:
public class ElectionMod2
{
//x = television advertising
//y = get out the vote
//z = dirty tricks
double[] Alist = new double[241];
double[] Blist = new double[241];
double[] Clist = new double[241];
public ElectionMod2()
{
for(int x = 0; x <= 10; x++)
{
for(int y = 0; y <= 20; y++)
{
for(int z = 0; z <= 4; z++)
{
int price = 100000*x + 50000*y + 250000*z;
if(price <= 1000000)
{
for(int i=0; i< Alist.length; i++)
{
if( 2 <= x && x < 4 && 4 <= y && y < 8)
{
Alist[i] = 0.01;
}
if( 4 <= x && x < 6 && 8 <= y && y < 12)
{
Alist[i] = 0.02;
}
else if( 6 <= x && x < 8 && 12 <= y && y < 16)
{
Alist[i] = 0.03;
}
else if( 8 <= x && x < 10 && 16 <= y && y < 20)
{
Alist[i] = 0.04;
}
else if( 10 <= x && 20 <=y)
{
Alist[i] = 0.05;
}
else
{
Alist[i] = 0;
}
}
for(int j=0; j > Blist.length; j++)
{
if (4 <= x && x < 8)
{
Blist[j] = 0.01;
}
else if (8 <= x)
{
Blist[j] = 0.02;
}
else
{
Blist[j] = 0;
}
}
for(int k=0; k > Clist.length; k++)
{
if (2 <= x && x < 4 && 1 == z)
{
Clist[k] = 0.01;
}
else if (4 <= x && x < 6 && 2 == z)
{
Clist[k] = 0.02;
}
else if (6 <= x && x < 8 && 3 == z)
{
Clist[k] = 0.03;
}
else if (8 <= x && 4 == z)
{
Clist[k] = 0.04;
}
else
{
Clist[k] = 0;
}
}
}
else
{
//System.out.println("over");
}
}
}
}
}
public double[] A_call()
{
return Alist;
}
public double[] B_call()
{
return Blist;
}
public double[] C_call()
{
return Clist;
}
}
and I can't figure out how to fix it. I'm thinking it has something to do with my array setup. Anyone have any ideas? I'd really appreciate it
Test.java:5: cannot find symbol
symbol : variable A_call
location: class Test
A_call.Alist = new A_call();
^
Test.java:5: cannot find symbol
symbol : class A_call
location: class Test
A_call.Alist = new A_call();
^
Test.java:6: cannot find symbol
symbol : variable Alist
location: class Test
double a_value = Alist[100];
Here's the test code:
public class Test
{
public static void main (String [] args)
{
A_call.Alist = new A_call();
double a_value = Alist[100];
System.out.println(+a_value);
}
}
and the class itself:
public class ElectionMod2
{
//x = television advertising
//y = get out the vote
//z = dirty tricks
double[] Alist = new double[241];
double[] Blist = new double[241];
double[] Clist = new double[241];
public ElectionMod2()
{
for(int x = 0; x <= 10; x++)
{
for(int y = 0; y <= 20; y++)
{
for(int z = 0; z <= 4; z++)
{
int price = 100000*x + 50000*y + 250000*z;
if(price <= 1000000)
{
for(int i=0; i< Alist.length; i++)
{
if( 2 <= x && x < 4 && 4 <= y && y < 8)
{
Alist[i] = 0.01;
}
if( 4 <= x && x < 6 && 8 <= y && y < 12)
{
Alist[i] = 0.02;
}
else if( 6 <= x && x < 8 && 12 <= y && y < 16)
{
Alist[i] = 0.03;
}
else if( 8 <= x && x < 10 && 16 <= y && y < 20)
{
Alist[i] = 0.04;
}
else if( 10 <= x && 20 <=y)
{
Alist[i] = 0.05;
}
else
{
Alist[i] = 0;
}
}
for(int j=0; j > Blist.length; j++)
{
if (4 <= x && x < 8)
{
Blist[j] = 0.01;
}
else if (8 <= x)
{
Blist[j] = 0.02;
}
else
{
Blist[j] = 0;
}
}
for(int k=0; k > Clist.length; k++)
{
if (2 <= x && x < 4 && 1 == z)
{
Clist[k] = 0.01;
}
else if (4 <= x && x < 6 && 2 == z)
{
Clist[k] = 0.02;
}
else if (6 <= x && x < 8 && 3 == z)
{
Clist[k] = 0.03;
}
else if (8 <= x && 4 == z)
{
Clist[k] = 0.04;
}
else
{
Clist[k] = 0;
}
}
}
else
{
//System.out.println("over");
}
}
}
}
}
public double[] A_call()
{
return Alist;
}
public double[] B_call()
{
return Blist;
}
public double[] C_call()
{
return Clist;
}
}