public double rate(int year){
double r = 7.7/100;
if(year<=1){
r *= 0.5;
} else if(year<=3){
r *= 0.7;
} else if(year<=5){
r *= 1;
} else {
r *= 1.1;
}
return r;
}