📄 buyhouse.java
字号:
/*
*while循环控制结构的测试
*/
public class BuyHouse
{
public static void main(String[] args)
{
final double HOUSEFUND = 200000;
double salary = 2000;
double fund = 0;
int years = 1;
while (fund < HOUSEFUND)
{
fund += salary*0.05*12;
years++;
salary = salary * 1.1;
}
System.out.println("the total years is: " + years);
System.out.println("the total fund is : " + fund);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -