Results 1 to 5 of 5

Thread: My table program

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145
    --------------------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;
    }
    Last edited by Butnud; Mar 13th, 2002 at 05:08 PM.
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width