⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 用于计算住房按揭贷款 输入:贷款金额、按揭期(月)数及银行利率(五年内和五年外) 输出:等额本息月供、贷款利息总额、剩余本金及支付利息金额
💻 CPP
字号:
#include "Debt.h"
#include "AccDebt.h"

void ShowLogo()
{
	cout<<"     *****************************************************"<<endl;
	cout<<"     *    Programmed by Ding Wen, IMIT, Wuhan University *"<<endl;
	cout<<"     *          All right reserved, 2/16/09              *"<<endl;
	cout<<"     *****************************************************"<<endl;
}

void main()
{
	ShowLogo();
	Debt Db1;
	double _T;
	double _NinYear;
	double _Rate5, _Rate30;
	int nMonth;
	cout<<"How much do you owe our bank?(Yuan) :";
	cin>>_T;
	cout<<"How many year do you plan to pay off the debt? (Year) :";
	cin>>_NinYear;
	cout<<"The 5-year rate and beyond-5-year rate (per-year, %) :";
	cin>>_Rate5>>_Rate30;

	Db1.GetR(_Rate5/12.0/100.0, _Rate30/12.0/100.0);
	Db1.GetT(_T);
	Db1.GetN(_NinYear*12);

	Db1.CalP();
	Db1.CalIncrement();
	Db1.CalPayTable();

	Db1.ShowInfo();
	cout<<"########### Want to know your debt after nMonth ? ###############"<<endl;
	cout<<"nMonth = ";
	cin>>nMonth;
	Db1.RemainAft(nMonth);
	cout<<"The remain debt is :"<<Db1.Remain<<" Yuan."<<endl;
	cout<<"During "<<nMonth<<" months, the debe has reduced :"<<Db1.T-Db1.Remain<<" Yuan."<<endl;
	cout<<"And the interest you have paid is :"<<nMonth*Db1.P-(Db1.T-Db1.Remain)<<" Yuan."<<endl;
	cout<<"#################################################################"<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -