Error at line 61 expected ";" before...

Hello all i get an error in cygwin @ line 61 "error expected ";" before "income_tax". I have no idea what the problem is and im fairly new to c++ and coding in general. This is a homework assignment in my structured programing class to fig error in some code. Any Help would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//*
//* This program takes in the salary of the employee from standard input.
//* It then deducts the income tax from the salary on the following basis :
//*      30% income tax if the salary is above $15000.
//*      20% income tax if the salary is between $7000 and $15000.
//*      10% income tax if the salary is below $7000.
//* The salary, income tax and the net salary is then outputted to standard output.
//*/

#include <iostream>
#include <iomanip>
#include <cctype>

using std::cout;
using std::cin;
using std::setw;
using std::endl;
using std::fixed;
using std::setprecision;

int main()
{
    char answer;
    int tax_rate = 0;
    double salary = 0;
    double income_tax = 0;
    double net_salary = 0;

    //do-while loop that allows the user to calculate the net salary for more than one
    //employee
    do{
        //prompt user for salary and read it in
        cout << "Enter the salary : ";
        cin >> salary;

        //check and make sure we got a positive salary
        //if not tell the user they made a mistake and ask again
        while(salary < 0);{
            cout << "The employess salary must be non-negative!" << endl;
            cout << "Enter the salary : ";
            cin >> salary;
        }

        //calculate tax rate and income tax based on table at the top of this file.
        if(salary>15000){
            income_tax=salary*30;
            tax_rate==30;
        }if(salary>=7000){
            income_tax=salary*20/100;
            tax_rate==20;
        }else
            income_tax=salary*10/100;
            tax_rate==10;

        //calculate net salary
        net_salary=salary+income_tax;

        //ouput everything to user
        cout << fixed << setprecision (2);
        cout << "Salary = $" << salary << endl;
        cout << "Your income tax @ " << tax_rate << "% = $ " income_tax << endl;
        cout << "Your net salary = $" << net_salary << endl;
        //check to see if the user wants to repeat the process
        cout << "Enter a Y to calculate the net salary of another employee or any other character to exit: ";
        //ignore the whitespace left from previous cin statements
        cin.ignore();
        cin.get(answer);
        //convert answer to lowercase -- makes comparisons easier
        answer = tolower(answer);
    }while(answer = 'y');

    return 0;
}
You have no << operator before incometax on line 61.
Topic archived. No new replies allowed.