code is below

int average(){ //method in class
int total = 0;
int NOS=5;


System.out.println("");
for(int i=0;i<10;i++){
if(ID ==" "){
NOS = i;
break;
}
total += mark;// total is the problem, tried printing it
// while thefor loop was running and at the end
// and its says "0" all the time why?
NOS++;


}



int avg = (total/NOS);


System.out.println(avg);
return avg;

think you could post a little more code, and with code tags?

There should be an Edit button for you, and as for deleting it, I guess you would need to ask a mod.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.