Well my job was to create a program that would get the gross pay, taxes and net pay based on the following info; $10/hr, Overtime(excess of 40 hrs: $15/hr, 15%tax on first $300, 20% on next $150, and 25% tax on the rest. I did this and it works for lower number like 27 hours, but when I get into higher hours and overtime stuff doesn't work. Any tips?
#include<iostream>
using namespace std;
// List Functions
float Payrate(int hours_worked);
float Tax1(float First300);
float Tax2(float Next150);
float Tax3(float FinalMoney);
int main()
{
int Hours,Gross_pay;
float Total_Tax,Net_Pay;
float T1 = 0;
float T2 = 0;
float T3 = 0;
cout<< "How many hours have you worked this week?\n";
cin>> Hours;
Gross_pay = Payrate(Hours);
Why do you use completely pointless while loop?
How the Tax counted? Is $500 tax is 300*.15 + 150*.20 + 50*.25?
If so, your tax2 and tax3 functions is wrong. You either need to pass (Gross_pay - 300) (or - 450 ( - 300 - 150) for Tax3) or to deduce 300|450 in those functions.