貸款計算器源碼
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");
}