public class J5_7 {
public static void main(String[] args) {
// TODO Auto-generated method stub
double tuitionFee = 10000;
double total = 0;
for(int i = 1;i<=10;i++)
{
tuitionFee = tuitionFee+tuitionFee*0.05;
if(i<=4)
total += tuitionFee;
}
System.out.printf("Ten years ago tuition fee is:%3.2f\n",tuitionFee);
System.out.printf("four years total :%3.2f\n",total);
}
}
Java语言程序设计(基础篇)第十版 5.7
最新推荐文章于 2023-11-01 16:03:24 发布