Answer to Question #26648 in C for jacob

Question #26648
Hi could you please help me to write a wage calculator in C programming, that includes hourly rate, gross salary and annual salary please.
1
Expert's answer
2013-03-19T10:53:27-0400
#include<iostream>
&
using std::cout;
using std::cin;
using std::endl;
&
int main()
{
&
& int hoursWorked;
& int tax;
& double hourlyWage;
& double salary;
& double overtime;
& double gross;
&
& do {
&
cout << "\nEnter hours worked (-1 to End): ";
cin >> hoursWorked;
&
& if (hoursWorked == -1)
& break;
&
cout << "Enter the employees hourly wage: ";
cin >> hourlyWage;
&
if (hoursWorked>40){
overtime = (hoursWorked-40)*1.5;
hoursWorked = 40;
salary = ((hourlyWage * hoursWorked) + (overtime * hourlyWage));
}
else
salary = (hourlyWage*hoursWorked);
&
cout << "Salary is: " << salary;
&
} while (hoursWorked != -1);
& &
& gross = salary * (100 - tax) / 100;
&
& cout << "Gross Salary is: " << gross;
&
return 0;
& }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS