//bank.java--父类
public class bank{
int savedMoney;
int year;
double interest;
double interestRate=0.29;
public double computerInterest(){
interest=year*interestRate*savedMoney;
return interest;
}
public void setInterestRate(double rate){
interestRate=rate;
}
}
~
~
~
~
~
~
~
~
~
~
"bank.java" 14L, 246C
//construction.java
public class constructionBank extends bank{
double year;
public double computerInterest(){
super.year=(int)year;
double r=year-(int)year;
int day=(int)(r*1000);
double yearInterest=super.computerInterest();
double dayInterest=day*0.0001*savedMoney;
interest=yearInterest+dayInterest;
System.out.printf("建设银行存款利息为:%f\n",interest);
return interest;
}
}
~
~
~
~
~
~
~
~
~
"constructionBank.java" 15L, 367C
//guangzhouBank.java
public class guangzhouBank extends bank{
double year