Answer to Question #294562 in C++ for Nal

Question #294562

Write a c++ program that computes the monthly net pay of the employee for a steel factory. The input for this program is the hourly rate of pay, the number of regular and the overtime hour work. The tax-deductible rate is 20%. You need first to calculate the gross pay, which is the sum of the wages earned from regular hours and overtime hours, the overtime is paid at 1.5 times the regular rate. Then you subtract the tax from the gross pay to get the net pay of the employee.


1
Expert's answer
2022-02-06T14:16:12-0500


#include <iostream>


using namespace std;




int main() {
	float rate_of_pay,regular_hours,overtime_hours,grosspay,netpay,tax;
	cout<<"Enter the Hourly rate of pay: ";
	cin>>rate_of_pay;
	cout<<"Enter the number of Regular hours: ";
	cin>>regular_hours;
	cout<<"Enter the number of Overtime hours: ";
	cin>>overtime_hours;
	grosspay=(regular_hours*rate_of_pay)+(1.5*overtime_hours*rate_of_pay);
	tax=0.2*grosspay;
	netpay=grosspay-tax;
	cout<<"Employee's Gross pay =  "<<grosspay<<"\n";
	cout<<"Tax = "<<tax<<"\n";
	cout<<"Employee's Net pay = "<<netpay<<"\n\n";


	cin>>tax;
	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
New on Blog