Couple issues:
Line 14: double emp_ID, hrs_worked, wage_hourly, ot_hrs; totalO_hrs,taxable_amount, Fed_tax_to, OH_tax_to, total_pay;
There's a semi-colon in the middle of your variable declarations.
Line 57: else (emp_ID == 1144)
else statements do not have any arguments after them. They're there to say "everything else", meaning there are no stipulations. If you want this to have an argument, it needs to be
else if
.
You first while statement is only going to work when count is less than 4. If you don't give count an initial value, it's going to pick up a random one and you'll probably skip the while statement entirely 99.9% of the time. You have also created an endless loop as long as the employee ID is 1122, as the while loop has no way to break out if this is true... and, I'm not quite sure why you nested another if statement within that one on line 24 as it's completely impossible for that statement to ever be true. The second if statement will only be checked if emp_ID is 1122, but the code under the if statement will only happen if emp_ID is 1133 or 1144... which is impossible if it's set to 1122. So yeah, you have your work cut out for you.
Try practicing reading your code out loud, and walk yourself through what your code will be doing in very simple steps. For 'if' statements, ask yourself what will happen when something ISN'T true. Ask yourself things like, "Is that what I want it to do?". Imagine actually putting the data into the console, and imagine what will happen with different values. If you can't imagine it like that, use cout statements to verify that a certain piece of code has ran and run the program (even if you have to create a test.cpp file and just put bits of your code into it to test each part).
Also, you'll need to use the command
cin.ignore(1000,'\n');
after
cin >> emp_ID;
. Your getline statement is recognizing the new line statement at the end of your employee ID and taking that as it's input. the cin.ignore statement will essentially tell the system to ignore everything after the value input of 1122.
Oh, and you need to completely revisit your book on if/else if/else statements. Your hourly wage section is not kosher at all. You should never have an else if statement that runs off the exact same argument as another one in the same string of if else statements. Simply place whatever code you were going to put in the second one under the first else if statement. For example:
1 2 3 4 5 6 7 8 9 10
|
else if (wage_hourly < 7.70)
{
if (hrs_worked > full_time)
taxable_amount = wage_hourly * totalO_hrs + 15.00;
}
else if (wage_hourly < 7.70)
{
if (hrs_worked <= full_time)
taxable_amount = wage_hourly * hrs_worked + 15.00;
}
|
can be condensed into:
1 2 3 4 5 6 7
|
else if (wage_hourly < 7.70)
{
if (hrs_worked > full_time)
taxable_amount = wage_hourly * totalO_hrs + 15.00;
else
taxable_amount = wage_hourly * hrs_worked + 15.00;
}
|
although even that is not going to be mathematically correct. Can you explain your math for not only calculating the taxable amount (what does the 15.00 represent?), but also how you calculate the totalO_hrs? It makes no sense to me at all.