Hi,
I was coding the following program..
// Program takes work hours and rate per hour and gives total
// salary after tax, if work hours are over 40, its increased by 1.5x.
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
double hr_work, hr_rate, taxed_total, total;
cout <<"Enter Hours Worked (Zero to Quit): ";
cin >> hr_work;
cout <<"\nEnter Hourly Rate: ";
cin >> hr_rate;
while(hr_work>0 && hr_rate>0){
total = hr_work*hr_rate;
taxed_total = total - (0.18 * total);
cout <<"\nGross Wage = "<<total;
cout <<"\nGross Wage after Tax Deduction = "<<taxed_total;
cout <<"\n\n---------------------------------\nEnter Hours Worked (Zero to Quit): ";
cin >> hr_work;
cout <<"\nEnter Hourly Rate: ";
cin >> hr_rate;
}
getch();
return 0;
}
Now how do i make the program do the following:
If the the number Hour entered it :
45 , then the following should happen:
40 + (5 x 1.5) = 47.5
and that 47.5 should be then multiplied with hourly rate and so on..
so any help is appreciated:-/