Click to See Complete Forum and Search --> : cannot resolve symbol error


w102eaj
10-30-2003, 05:05 PM
i am writing a program used for inputting grades. when i try to compile the program i get an error saying cannot resolve symbol, variable array, variable values. any ideas on what to do would be greatly appreciated. below is sample of the code i’m having problems with: i put // where the problem is

import java.io.*;
import MyInput;
public class lab5_141
{
static final int MAX=5;
public static void main(String[]args)
{
int array[]=new int[MAX];
int values;
int choice;
System.out.println("Welcome to grades");
System.out.println();

do{
System.out.println("1 - Input Grades");
System.out.println("2 - List Grades");
System.out.println("3 - Change Grades");
System.out.println("4 - Convert Grades");
System.out.println("5 - Exit");
System.out.println();
System.out.print("Enter Choice ");
choice=MyInput.readInt();
System.out.println();

switch(choice)
{
case 1: values=get_grades(array);
break;
case 2: list_grades(array, values);//problem begins
break; //here
case 3: change_grades(array, values);//
break;
case 4: convert_grades(array, values);//
break;
case 5: System.out.println("Goodbye");
break;
}
}while((choice < 0) || (choice > 5));
}//end main;)

Khalid Ali
10-30-2003, 08:52 PM
First of all its JavaScript forum not Java..:D

Second ,do have all the methods which you are calling in your switch segment defined somewhere???

w102eaj
10-30-2003, 08:57 PM
excuse me but i'm new to java and didn't realize there was a difference between java and java script. yes all methods are defined in the program and i solved the problem by making the switch statement, if/else statements. thanks anyway.