CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Posts
    38

    Monthly tax program

    Hi guys, I have to write a monthly charge program where you it asks for the user to enter the month year and income, and the program will calculate it product sales tax with the equation S=T/1.06. But i keep getting the error "total doesnt have a ;" and "total is used before its value is set".

    so far i have

    #include <iostream>
    using namespace std;

    int main ()

    {

    int sales , total , year;
    char month[10];

    cout << "Please enter the month for this report:";
    cin >> month;
    cout << "Please enter the year for this report:";
    cin >> year;
    cout << "Please enter the total income for this month:"
    cin >> total;
    sales = total / 1.06;
    cout << "The sales amount is "<< sales << endl;

    return 0;

    }


    Please help

  2. #2
    Join Date
    Oct 2009
    Posts
    38

    Re: Monthly tax program

    oops nevermind i forgot a ; on line 15.

  3. #3
    Join Date
    Oct 2009
    Posts
    38

    Re: Monthly tax program

    but now i dont know how to display the file like this..

    bash-2.04$ a.out
    Please enter the month for this report: February
    Please enter the year for this report: 2005
    Please enter the total income for this month: 15000.25
    Sales Tax Report Saved to file: SalesTaxData.txt

    bash-2.04$ cat SalesTaxData.txt

    Month: February 2005
    -----------------------
    Total Collected: $ 15000.25
    Sales: $ 14151.18
    County Sales Tax: $ 283.02
    State Sales Tax: $ 566.05
    Total Sales Tax: $ 849.07
    -----------------------

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

Featured