Reputation: 11
i had an error although i compiled Semester1 class and they are at the same package
public class Semester2{
String subjects2[] = {"Arabic 2","Islamic 2","English 2","calculas","java1","manegment","physecs2"};
double degrees2[] = new double [7];
int hours2[] = {2,2,2,4,4,2,3};
double subjectpoint2[] = new double[7];
String[]estimate2 = new String[7];
double fullDegree2 = 0;
int fail2 = 0; //fail subjects
public Semester2(){
}
public Semester2(double degrees2[],String subjects2[]){
for(int i=0;i<7;i++){
this .degrees2[i] = degrees2[i];
subjectpoint2[i] = degrees2[i] / 25;
fullDegree2 = 0;
fail2 = 0;
} //end of for
} //end of constructer
public double Semester2Method(double degrees2[],String subjects2[],String[]estimate2,double fullDegree2,int fail2,double subjectpoint2[],int hours2[]){
for(int i=0;i<7;i++){
if ((degrees2[i] > 100)|(degrees2[i] < 0)){
System.out.println("this degree is imposible");
i--;
continue;
} //end of if
if (degrees2[i] < 40)
fail2 ++;
else
if (subjectpoint2[i] >= 3.6)
estimate2[i]="A+";
if (subjectpoint2[i] >= 3.2)
estimate2[i] = "A";
if (subjectpoint2[i] >= 2.8)
estimate2[i] = "B+";
if (subjectpoint2[i] >= 2.6)
estimate2[i] = "B";
if (subjectpoint2[i] >= 2.4)
estimate2[i] = "C+";
if (subjectpoint2[i] >= 2.0)
estimate2[i] = "C";
if (subjectpoint2[i] >= 1.6)
estimate2[i] = "D";
else
estimate2[i] = "F";
fullDegree2 += subjectpoint2[i] * hours2[i];
}//end of for
Semester1 [] obj=new Semester1[2];
obj[0]=new Semester1();
obj[1]=new Semester1(degrees[7],subjects[7]);
//Semester1 obj = new Semester1();
double avarge = fullDegree2 /19;
double cavarge=( fullDegree2 + obj[1].fullDegree )/( 21 + 19 );
return cavarge;
} //end of the method
} //end of semester2
here is the error error: cannot find symbol
Semester1 [] obj=new Semester1[2];
^
Upvotes: 0
Views: 853
Reputation: 6077
Your Semester1.java
file has not been compiled, as I can guess from your comments. You need to first compile that file. That would create Semester1.class
file. Then you should compile Semester2.java
. I think this should work.
Upvotes: 1
Reputation: 169
check if Semester1.class file is created by checking in the file directory
Upvotes: 0