📄 test.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 + -