Tumkur

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 124.124.120.18 (talk) at 06:00, 22 January 2012. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

public class topscore {

private static final int NULL = 0;

public void searchlow(Studentsc[] list4) { int i=0; int j=0; String list[]=new String[list4.length]; String list2[]=new String[list4.length]; String list3[]=new String[list4.length]; String list6[]=new String[list4.length]; for(i=0;i<list4.length;i++) { if((list4[i].getscore()>0)&&(list4[i].getscore()<50)) { list[j]=list4[i].getname(); j++; } else if((list4[i].getscore()>=50)&&(list4[i].getscore()<65)) { list2[j]=list4[i].getname(); j++; } else if((list4[i].getscore()>=65)&&(list4[i].getscore()<80)) { list3[j]=list4[i].getname(); j++;

} else if((list4[i].getscore()>=80)&&(list4[i].getscore()<=100)) { list6[j]=list4[i].getname(); j++; } } for(i=0;i<list.length;i++) {

if(list.length!=NULL) {

System.out.println("student scored 0-50"+list[i]); } } for(i=0;i<list2.length;i++) { if(list2.length!=NULL) { System.out.println("student scored 50-65"+list2[i]); } } for(i=0;i<list3.length;i++) { if(list3.length!=NULL) { System.out.println("student scored 65-80"+list3[i]); } } for(i=0;i<list6.length;i++) { if(list6.length!=NULL) { System.out.println("student scored 80-100"+list6[i]); } }

} }



public class Student {


public static void main(String[] args) { Studentsc s1=new Studentsc("lekhana",12,22,70); Studentsc s2=new Studentsc("manasa",13,22,92); Studentsc s3=new Studentsc("veena",14,22,55); Studentsc s4=new Studentsc("purni",15,22,79); Studentsc s5=new Studentsc("manaswi",16,22,67); Studentsc s6=new Studentsc("mamtha",17,22,32); Studentsc[] list1={s1,s2,s3,s4,s5,s6}; topscore t1=new topscore(); t1.searchlow(list1);


}

}