贷款计算器源码
A. 用c++设计一个房贷计算器,在输入贷款总额,贷款年利率以及借贷月数后,能更具上述公式计算每月还款额
贷款月数和还款次数相等?我不是很清楚那个还款,我的算法是每一个月还款剩余的本金在计算每月本金的,也就是说每月本金不相同,你可以把问题描述的更加详细点,我在给修改修改
# include<iostream>
using namespace std;
int main()
{
int a,n,i; //a表示贷款金额 n代表借贷月数
float k,s,p,q,m; //k代表年利率 s代表每月还款额 p代表每月本金 q代表每月利息 m表示上月本金
cout<<"请输入贷款金额"<<"a=";
cin>>a;
cout<<"请输入借贷月数"<<"n=";
cin>>n;
cout<<"请输入年利率"<<"k=";
cin>>k;
for(i=1;i<=n;i++)
{
p=a/n;
m=a-(p*i);
q=m*(k/12);
s=p+q;
cout<<"第"<<i<<"个月的还款金额为"<<"s="<<s<<endl;
a-=s;
}
return 0;
}
我运行试了,你看看可以不可以,不可以的话我在给改改
B. 你有房贷计算器源码么
问题选择标签了,源码需要在编程标签问的,祝你早日找到答案!
C. 利用python设计一个简单的房贷计算器房贷计算公式如下:Ø每月月供参考=贷款金额 ×[月利率×(
摘要 对的你把你贷款总数。贷款的年限。商业贷款还款有两种情况。在搜索引擎里直接搜索贷款计算器。按一下手指就能算出来非常准确。丽丽你要告诉我就可以直接算了。
D. 求一个基于c++的贷款计算器的软件,附源码。。。。。。
发私信给你了
E. java简易贷款计算机
你也不说计算公式,不知道怎么计算,我去网上找了一个月支付款的计算公式,不知道和你题目的要求是否一样,如果不一样你就改下公式就行。 java代码如下: public class Loan { public static void main(String[] args){ double rate ;//利率 int year ; //年数 double money ; //贷款总额 double monthpay ;//月付款 Scanner sc = new Scanner(System.in); System.out.println("输入月利率:"); rate = sc.nextDouble(); System.out.println("输入年数:"); year = sc.nextInt(); System.out.println("输入贷款总额:"); money = sc.nextDouble(); //计算月付款 monthpay = (money * rate)/Math.abs(1 - (1 / (1 + rate ) * year * 12 )); System.out.println("每月应该还贷款:" + monthpay); }}
F. 求一个 java 个人贷款还款计算器 的源代码,
import javax.swing.JOptionPane;
public class Pay {
public static void main(String args[]){
String loanString = JOptionPane.showInputDialog("请输入贷款本金( loanAmout):such as 20000.00") ;
double loanAmount= Double.parseDouble(loanString);
String dateString = JOptionPane.showInputDialog("请输入贷款期(loanDate):between 24-60");
int loanDate = Integer.parseInt(dateString);
String monthRateString = JOptionPane.showInputDialog("请输入月利率 (MonthRate):such as 0.00005");
double monthRate = Double.parseDouble(monthRateString);
double pay_Per_Month = (loanAmount+loanAmount * loanDate * monthRate)/loanDate;
JOptionPane.showMessageDialog(null, pay_Per_Month);
}
}
G. 求一个关于个人贷款计算器的代码
这么简单的页面,给你个公式,自己算吧
每期应还款额=【借款本金×月利率×(1+月利率)^还款期数】/【(1+月利率)^还款期数-1】
H. 请大神写一段贷款计算器的jsp源码
等额本息=pmt(4%,12,10000),去EXCEL里输入试试。
I. C++ c语言程序设计 题目:贷款计算器
/*
* main.c
*
* Created on: 2011-6-8
* Author: icelights
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#define APR1 0.0747 /*<1年(含1年)年利率*/
#define APR2 0.0756 /*1-3年(含3年)年利率*/
#define APR3 0.0774 /*3-5年(含5年)年利率*/
#define APR4 0.0783 /*5年以上年利率*/
#define A_TO_M 1/12 /*月利率 = 年利率 / 12*/
#define RTP 12 /*Reimbursement total periods还款总期数 =年限*12*/
#define LENGTH 80
struct LoanInfo
{
/*姓名*/
char name[LENGTH];
/*贷款总额*/
double LoanAmount;
/*贷款年限*/
double LoanYear;
/*月付*/
double MonthlyPayment;
/*总利息*/
double TotalInterest;
/*还款总额*/
double ReimbursementAmount;
/*年利率*/
double apr;
struct LoanInfo * next;
};
void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv);
int main(void)
{
int temp;
struct LoanInfo * head = NULL;
struct LoanInfo * prev, * current;
current = (struct LoanInfo *)malloc(sizeof(struct LoanInfo));
if (NULL == head)
{
head = current;
}
else
{
prev->next = current;
}/*End of if (NULL == head)*/
puts("请输入姓名");
gets(current->name);
fflush(stdin);
puts("请输入贷款数额(单位:万元)");
scanf("%lf", ¤t->LoanAmount);
fflush(stdin);
puts("请输入贷款年限");
scanf("%lf", ¤t->LoanYear);
fflush(stdin);
printf("姓名:%s,贷款年限:%lf, 贷款数额%lf",
current->name, current->LoanYear, current->LoanAmount);
prev = current;
puts("请确认Y/N");
temp = getchar();
switch(toupper(temp))
{
case 'Y' : CalcShow(current, head, prev);
break;
case 'N' : free(current);
main();
break;
default : puts("输入错误");
free(current);
break;
}
return 0;
}
void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv)
{
char lcv_temp;
if (cur->LoanYear <= 1)
cur->apr = APR1;
else if (cur->LoanYear <= 3)
cur->apr = APR2;
else if (cur->LoanYear <= 5)
cur->apr = APR3;
else
cur->apr = APR4;
/*End of if (year <= 1)*/
cur->LoanAmount = 10000 * cur->LoanAmount;
cur->ReimbursementAmount = cur->LoanAmount * pow((1 + cur->apr), cur->LoanYear);
cur->MonthlyPayment = cur->ReimbursementAmount / (cur->LoanYear * RTP);
cur->TotalInterest = cur->ReimbursementAmount - cur->LoanAmount;
printf("姓名:%s 贷款年限:%.0lf\n"
"贷款数额:%.2lf 每月还款额:%.2lf\n"
"利息合计:%.2lf 还款总额:%.2lf\n",
cur->name, cur->LoanYear, cur->LoanAmount,
cur->MonthlyPayment, cur->TotalInterest, cur->ReimbursementAmount);
puts("是否继续计算Y/N");
lcv_temp = getchar();
switch(toupper(lcv_temp))
{
case 'Y' : free(cur);
main();
break;
case 'N' : free(cur);
exit(0);
default : puts("输入错误");
free(cur);
main();
break;
}
system("pause");
}
J. c语言贷款计算器的源程序
/*
* main.c
*
* Created on: 2011-6-8
* Author: icelights
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#define APR1 0.0747 /*<1年(含1年)年利率*/
#define APR2 0.0756 /*1-3年(含3年)年利率*/
#define APR3 0.0774 /*3-5年(含5年)年利率*/
#define APR4 0.0783 /*5年以上年利率*/
#define A_TO_M 1/12 /*月利率 = 年利率 / 12*/
#define RTP 12 /*Reimbursement total periods还款总期数 =年限*12*/
#define LENGTH 80
struct LoanInfo
{
/*姓名*/
char name[LENGTH];
/*贷款总额*/
double LoanAmount;
/*贷款年限*/
double LoanYear;
/*月付*/
double MonthlyPayment;
/*总利息*/
double TotalInterest;
/*还款总额*/
double ReimbursementAmount;
/*年利率*/
double apr;
struct LoanInfo * next;
};
void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv);
int main(void)
{
int temp;
struct LoanInfo * head = NULL;
struct LoanInfo * prev, * current;
current = (struct LoanInfo *)malloc(sizeof(struct LoanInfo));
if (NULL == head)
{
head = current;
}
else
{
prev->next = current;
}/*End of if (NULL == head)*/
puts("请输入姓名");
gets(current->name);
fflush(stdin);
puts("请输入贷款数额(单位:万元)");
scanf("%lf", ¤t->LoanAmount);
fflush(stdin);
puts("请输入贷款年限");
scanf("%lf", ¤t->LoanYear);
fflush(stdin);
printf("姓名:%s,贷款年限:%lf, 贷款数额%lf",
current->name, current->LoanYear, current->LoanAmount);
prev = current;
puts("请确认Y/N");
temp = getchar();
switch(toupper(temp))
{
case 'Y' : CalcShow(current, head, prev);
break;
case 'N' : free(current);
main();
break;
default : puts("输入错误");
free(current);
break;
}
return 0;
}
void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv)
{
char lcv_temp;
if (cur->LoanYear <= 1)
cur->apr = APR1;
else if (cur->LoanYear <= 3)
cur->apr = APR2;
else if (cur->LoanYear <= 5)
cur->apr = APR3;
else
cur->apr = APR4;
/*End of if (year <= 1)*/
cur->LoanAmount = 10000 * cur->LoanAmount;
cur->ReimbursementAmount = cur->LoanAmount * pow((1 + cur->apr), cur->LoanYear);
cur->MonthlyPayment = cur->ReimbursementAmount / (cur->LoanYear * RTP);
cur->TotalInterest = cur->ReimbursementAmount - cur->LoanAmount;
printf("姓名:%s 贷款年限:%.0lf\n"
"贷款数额:%.2lf 每月还款额:%.2lf\n"
"利息合计:%.2lf 还款总额:%.2lf\n",
cur->name, cur->LoanYear, cur->LoanAmount,
cur->MonthlyPayment, cur->TotalInterest, cur->ReimbursementAmount);
puts("是否继续计算Y/N");
lcv_temp = getchar();
switch(toupper(lcv_temp))
{
case 'Y' : free(cur);
main();
break;
case 'N' : free(cur);
exit(0);
default : puts("输入错误");
free(cur);
main();
break;
}
system("pause");
}