63 189
Assignments Done
99,3%
Successfully Done
In July 2018

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.
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions