i had error although compiled semester1 class , @ 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++){ .degrees2[i] = degrees2[i]; subjectpoint2[i] = degrees2[i] / 25; fulldegree2 = 0; fail2 = 0; } //end of } //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 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 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 method } //end of semester2
here error error: cannot find symbol
semester1 [] obj=new semester1[2]; ^
your semester1.java
file has not been compiled, can guess comments. need first compile file. create semester1.class
file. should compile semester2.java
. think should work.
Comments
Post a Comment