public class Hailstone{
public static int hailstoneLength(int n){
int length = 0;
int currentNum = n;
while(currentNum != 1){
length ++;
if(currentNum % 2) { // causes error
currentNum = currentNum/2;
}
else {
currentNum = 3*currentNum+1;
}
}
return length;
}
public static boolean isLong(int n){
return hailstoneLength(n) > n;
}
public static propLong(int n){ // forgot to return
int numLong = 0;
for(int i =0; i < n i++;){ // should be i<=n
if(isLong(i)){numLong++;}
}
return numLong/n;
}
}