如何改正错误
1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(9,6): error C2371: “month”: 重定义;不同的基类型1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(8): message : 参见“month”的声明
1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(26,11): error C2088: “<<”: 对于 class 非法
1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(33,12): error C2088: “<<”: 对于 class 非法
1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(36,42): error C2088: “<<”: 对于 class 非法
1>C:\Users\Administrator\source\repos\ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp(37,95): error C2088: “<<”: 对于 class 非法
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
double loanamount; double annualinterestrate; double monthlypayment; double month; double currentfacevalue; double interest; double repaidPrincipal;
int month = 1;
cout << "" << endl;
cout << "Welcome to the Personal Loan System" << endl;
cout << "========================================================================================================================" << endl;
cout << "" << endl;
cout << "Please enter the loan amount:";
cin >> loanamount;
cout << "Please enter the annual interestrate(%):";
cin >> annualinterestrate;
cout << "Please enter the monthlypayment:";
cin >> monthlypayment;
cout << "" << endl;
cout << "Month" << setw(20) <<"Current face value" << setw(20) << "Interest" << setw(25) << "Repaid Principal" << endl;
cout << "================================================================================================================" << endl;
currentfacevalue = loanamount;
interest = loanamount * annualinterestrate * 1 / 1200;
repaidPrincipal = monthlypayment - interest;
cout <<""<< month << setw(20) << "$" << currentfacevalue << setw(20) << "$" << interest << setw(25) << "$" << repaidPrincipal << endl;
while (currentfacevalue >= repaidPrincipal)
{
month += 1;
currentfacevalue -= repaidPrincipal;
interest = loanamount * annualinterestrate * 1 / 1200;
repaidPrincipal = monthlypayment - interest;
cout <<""<< month << setw(20) << "$" << currentfacevalue << setw(20) << "$" << interest << setw(25) << "$" << repaidPrincipal << endl;
if (currentfacevalue < repaidPrincipal)
{
cout << "Remaining Balance in month " << month << "=" << currentfacevalue << endl;
cout << "(Note: The remaining balance" << currentfacevalue << "with settled in the month " << month << "!)";
}
}