write the programme that implementes the following algorithms? start: read the total hours the employee has woked,Total hours. Read the hourly rate of pay for the employee,Hourly rate. gross salary=total hours*hourly rate. tax=gross salary *0.1 Net salary =gross salary-tax. Display net salary
#include <iostream>
using namespace std;
int main() {
double totalHour;
cout << "Enter total hours you have worked: ";
cin >> totalHour;
double hourlyRate;
cout << "Enter the hourly rate: ";
cin >> hourlyRate;
double grossSalary = totalHour * hourlyRate;
double tax = grossSalary * 0.1;
double netSalary = grossSalary - tax;
cout << "Net Salary = " << netSalary<< endl;
return 0;
}
Comments
Leave a comment