I am trying to write a looping switch case. You have four separate payroll options, each with their own steps. Once you are done with one person's payroll the program loops and you move onto the next. Almost everything seems perfect except that I am supposed to have a separate payment for workers who worked over 40 hours. I wrote a if else statement but it only gives the base pay. The if else is on lines 37-48
Your if statement says (salary >= 40). I'm assuming you wants hours there not salary, cause I would imagine it is just dropping into the else statement right now.
Thanks. I must have just made one of the dumbest mistakes to ever show up on this website. I do have one other question. I need the answers to every switch case to have two decimal places. I know I need to use setprecision(2), but I am unclear on where to put it.
Its been awhile since I've needed to do anything with set precision but I'm pretty sure it goes before the output. I believe it is on this site as well and will give you the details on how to use that properly.