java设计的房贷计算器
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
yuehuankuan = zonge1 / nian / 12 ;
for(int i=1;i <= nian*12;i++){
yuehuanbenjin =benBaidu Nhomakorabeain / nian /12;
yuehuankuan = (int) (yuehuanbenjin + lilv / nian / 12 *(nian * 12 - i)*yuehuanbenjin*0.01);
double yuehuanbenjin;
int zonge1;
int sum=0;
double chae;
boolean flag=true;
System.out.println("请根据菜单选择操作:");
while(flag)
{
Scanner sc=new Scanner(System.in);
nian= (int) reader1.nextDouble();
zonge1 = (int) (lilv * nian * 0.01 * benjin + benjin) ;
yuehuankuan = zonge1 / nian / 12 ;
for(int i=1;i <= nian*12;i++){
}
chae=zonge1-sum;
System.out.print("\n等额本息还款法还款总额"+zonge1+"元月还款额为"+ yuehuankuan+"元\n");
System.out.println("等额本金还款法还款总额为"+sum+"元\n");
System.out.print("等额本息还款法比等额本金还款法多还款"+chae+"\n\n按i/I继续计算按c/C退出程序");
Scanner reader1=new Scanner(System.in);
System.out.print("请输入年利率:");
lilv= reader1.nextInt();
System.out.print("请输入贷款总额:");
benjin= reader1.nextDouble();
System.out.print("请输入还款年限:");
System.out.print("等额本息还款法比等额本金还款法多还款"+chae+"\n\n按i/I继续计算按c/C退出程序");
break;
case'h':
case'H':
System.out.println("Clam down");
System.out.println("请根据菜单提示一步一步进行操作");
System.out.println("*房贷计算器*");
System.out.println("************************************************");
System.out.println("1。进入-> I *");
System.out.println("2。帮助-> H *");
System.out.println("3。退出-> C *");
System.out.println("************************************************"); //菜单提示
double lilv;
double benjin;
int nian;
int yuehuankuan;
String str=sc.next();
char ch=str.charAt(0);
switch(ch)
//使用switch语句,利用菜单选择输入内容
{
case'i':
case'I':
Scanner reader=new Scanner(System.in);
System.out.print("请输入年利率:");
lilv= reader.nextInt();
System.out.print("请输入贷款总额:");
benjin= reader.nextDouble();
System.out.print("请输入还款年限:");
nian= (int) reader.nextDouble();
zonge1 = (int) (lilv * nian * 0.01 * benjin + benjin) ;
yuehuanbenjin =benjin / nian /12;
yuehuankuan = (int) (yuehuanbenjin + lilv / nian / 12 *(nian * 12 - i)*yuehuanbenjin*0.01);
if(i>nian*12)
break;
sum=(int) (sum+yuehuankuan);
if(i>nian*12)
break;
sum=(int) (sum+yuehuankuan);
}
chae=zonge1-sum;
System.out.print("\n等额本息还款法还款总额"+zonge1+"元月还款额为"+ yuehuankuan+"元\n");
System.out.println("等额本金还款法还款总额为"+sum+"元\n");
//java编写的房贷计算器
//@王强出品
import java.util.*;
public class fangdai {
public static void main(String args[]) throws InterruptedException
{
System.out.println("************************************************");
break;
case 'c':
case 'C':
System.out.println("正在退出系统,谢谢您的使用!");
flag=false;
break;
default:
System.out.println("请根据菜单选择操作");
}
}
}
}
for(int i=1;i <= nian*12;i++){
yuehuanbenjin =benBaidu Nhomakorabeain / nian /12;
yuehuankuan = (int) (yuehuanbenjin + lilv / nian / 12 *(nian * 12 - i)*yuehuanbenjin*0.01);
double yuehuanbenjin;
int zonge1;
int sum=0;
double chae;
boolean flag=true;
System.out.println("请根据菜单选择操作:");
while(flag)
{
Scanner sc=new Scanner(System.in);
nian= (int) reader1.nextDouble();
zonge1 = (int) (lilv * nian * 0.01 * benjin + benjin) ;
yuehuankuan = zonge1 / nian / 12 ;
for(int i=1;i <= nian*12;i++){
}
chae=zonge1-sum;
System.out.print("\n等额本息还款法还款总额"+zonge1+"元月还款额为"+ yuehuankuan+"元\n");
System.out.println("等额本金还款法还款总额为"+sum+"元\n");
System.out.print("等额本息还款法比等额本金还款法多还款"+chae+"\n\n按i/I继续计算按c/C退出程序");
Scanner reader1=new Scanner(System.in);
System.out.print("请输入年利率:");
lilv= reader1.nextInt();
System.out.print("请输入贷款总额:");
benjin= reader1.nextDouble();
System.out.print("请输入还款年限:");
System.out.print("等额本息还款法比等额本金还款法多还款"+chae+"\n\n按i/I继续计算按c/C退出程序");
break;
case'h':
case'H':
System.out.println("Clam down");
System.out.println("请根据菜单提示一步一步进行操作");
System.out.println("*房贷计算器*");
System.out.println("************************************************");
System.out.println("1。进入-> I *");
System.out.println("2。帮助-> H *");
System.out.println("3。退出-> C *");
System.out.println("************************************************"); //菜单提示
double lilv;
double benjin;
int nian;
int yuehuankuan;
String str=sc.next();
char ch=str.charAt(0);
switch(ch)
//使用switch语句,利用菜单选择输入内容
{
case'i':
case'I':
Scanner reader=new Scanner(System.in);
System.out.print("请输入年利率:");
lilv= reader.nextInt();
System.out.print("请输入贷款总额:");
benjin= reader.nextDouble();
System.out.print("请输入还款年限:");
nian= (int) reader.nextDouble();
zonge1 = (int) (lilv * nian * 0.01 * benjin + benjin) ;
yuehuanbenjin =benjin / nian /12;
yuehuankuan = (int) (yuehuanbenjin + lilv / nian / 12 *(nian * 12 - i)*yuehuanbenjin*0.01);
if(i>nian*12)
break;
sum=(int) (sum+yuehuankuan);
if(i>nian*12)
break;
sum=(int) (sum+yuehuankuan);
}
chae=zonge1-sum;
System.out.print("\n等额本息还款法还款总额"+zonge1+"元月还款额为"+ yuehuankuan+"元\n");
System.out.println("等额本金还款法还款总额为"+sum+"元\n");
//java编写的房贷计算器
//@王强出品
import java.util.*;
public class fangdai {
public static void main(String args[]) throws InterruptedException
{
System.out.println("************************************************");
break;
case 'c':
case 'C':
System.out.println("正在退出系统,谢谢您的使用!");
flag=false;
break;
default:
System.out.println("请根据菜单选择操作");
}
}
}
}