Answer to Question #203191 in C++ for Dikeledi Matlala

Question #203191

Luthando Housing is a company that specializes in real estate business. It's properties are managed by sales representatives. Each sales representatives is allocated to at least one property to market and sell to prospective customers. After a trading month, these sales representatives receive their salaries as follows

Gross salary

Commission (2% of the sold property)

Less PAYE (12% of gross pay)

Less UIF (3% of gross pay)


Write a C++ program that calculates the net salary that each sales representative receives. The program should allow the user to input the gross salary and sales then output the net salary


1
Expert's answer
2021-06-04T07:48:34-0400
#include<iostream>
using namespace std;
double net_salary(double gross_salary, double sales){
	double net_income;
	double commission = 2 * sales / 100;


	double gross_pay = gross_salary + commission;
	
	double payee =  gross_pay * 12/100 ;
	double uif=  3 * gross_pay /100 ;
	double deduction = payee + uif;
	
	net_income = gross_pay - deduction;
	return net_income;
	
}
int main(){
	double sales, salary;
	cout<<"Enter the gross salary "<<endl;
	cin>> salary;
	cout<<"Enter sales"<<endl;
	cin>> sales;
	cout<<"Your net salary is: \t"<<net_salary(salary,sales)<<endl;

}

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

Dikeledi Matlala
04.06.21, 20:40

Thank You for answering my question. I really appreciate it.

Leave a comment

LATEST TUTORIALS
New on Blog