--------------------Configuration: table - Win32 Debug--------------------
Compiling...
table.cpp
C:\Documents and Settings\Rob Gross\Desktop\WestConn\C++\Midterms\table.cpp(33) : error C2374: 'month' : redefinition; multiple initialization
C:\Documents and Settings\Rob Gross\Desktop\WestConn\C++\Midterms\table.cpp(16) : see declaration of 'month'
C:\Documents and Settings\Rob Gross\Desktop\WestConn\C++\Midterms\table.cpp(35) : error C2061: syntax error : identifier 'payment'
Error executing cl.exe.
table.obj - 2 error(s), 0 warning(s)
Here is my latest code
I still get 2 errors and 1 warning
// formatted output with cout and manipulators
#include <iostream.h>
#include <iomanip.h>
float repayment(float);
int main()
{
float principal;
float payment = 2000;
float rate;
int month = ++month;
float remainder = (principal*rate)-payment;
cout << "Enter your principal: $";
cin >> principal;
cout << "Enter your rate: ";
cin >> rate;
rate / 100;
rate += 1; //it should be > 1, so remaining increases
cout << endl;
cout << "----------------------------------";
cout << endl;
cout << endl;
cin >> remainder;
cout << setiosflags(ios::left)
<< setw(12) << ++month
<< setw(12) << payment
<< setw(12) << remainder;
for (int month=1; month <= 35; month++){
remainder *= rate;
if payment=remainder; //repay exactly to $0
cout << setw(12) << "\nMonth" << setw(11) << "\nPayment" << setw(12) <<"\nRemainder\n";
}
cout << "\n\n";
return 0;
}




Reply With Quote