Answer:
The code is designed using C++ with comments
Explanation:
#include<bits/stdc++.h>
using namespace std;
int main(){
int pay, hours; //declaring hourly pay rate and number of hours worked
cout<<"Enter hourly pay rate: "<<endl; //taking user input
cin>>pay;
cout<<"Enter hours worked: "<<endl; //taking user input
cin>>hours;
int gross;
if (hours<=40){
gross=hours*pay; //calculating gross pay
}
else if (hours>40){
gross=40*pay+(hours-40)*1.5*pay; //calculating gross pay for overtime
}
int withholding, netpay;
//calculation of withholding..
if (gross>1000){
withholding=(gross*28)/100;
}
else if (gross>600 && gross<=1000){
withholding=(gross*21)/100;
}
else if (gross<=600){
withholding=(gross*10)/100;
}
netpay=gross-withholding; //calculation of netpay
cout<<"Gross pay is $"<<gross<<endl; //output
cout<<"Net pay is $"<<netpay<<endl; //output
return 0;
}