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
#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;
}
Comments
Thank You for answering my question. I really appreciate it.
Leave a comment