I have a method that returns a double. When I call this method and print its result, it prints out 10.3333333 for example. I would like the method to return a something like 10.3 instead.
The method is:
public double getscore() {
int x=0;
double x1=0;
for (int i=0; i<3 ;i++) {
x+=mark[i];
}
x1=x/3;
return (x1);
}
reference