Answer to Question #26648 in C for jacob
2013-03-17T15:03:19-04:00
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
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 !
Learn more about our help with Assignments:
C
Comments
Leave a comment