You are required to design a program to calculate the net salary of the employees working for the company.

You are working in a small company as a programmer. You are required to design a program
to calculate the net salary of the employees working for the company. The program should be
able to do repetition based on the number of employees in the company. The table of
calculation is given below:
Basic Salary Tax KWSP Housing Allowance
1 – 6000 9%
9% or 11%
7%
6001 – 8000 12%
8001 - 10000 15% 5%
10001 – 14000 20%
3%
14001 and above 25%
The first column shows the basic salary. The second column shows the compulsory tax
incurred which will be deducted from the basic salary. The third column shows the
compulsory deduction for KWSP contribution. The percentage will be based on whether the
employee chooses 9% or 11%. The fourth column shows the housing allowance that will be
paid by the company to the employee. This allowance is optional. If the employee applied the
allowance for that month, allowance will be paid; otherwise no allowance will be paid.
 Write the C++ program for this scenario
Please note that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.
#include<iostream>
#include<string>

using namespace std;

int main()

{
string name;
int kwsp, tax, housingallowence;
double salary, salaryaftertax, salaryafterkwsp, salaryafterhousingloan, salaryafterdeduction;

cout<<"---Employe Name---"<<endl;
cout<<"Enter Name: ";
cin>>name;

cout<<"---Salary Calculation---"<<endl;
cout<<"Enter Salary: ";
cin>>salary;

cout<<"---KWSP is in Percentage point---"<<endl;
cout<<"Enter KWSP 9% or 11% : ";
cin>>kwsp;

salaryafterdeduction = (( salary - (kwsp + tax )) + ( salary + housingallowence ));

if(salary>=1 && salary<=6000)
cout<<"Your salary is : RM "<<salaryafterdeduction<<endl;
else if(salary>=6001 && salary<8000)
cout<<"Your salary is : RM "<<salaryafterdeduction<<endl;
else if(salary>=8001 && salary<10000)
cout<<"Your salary is : RM "<<salaryafterdeduction<<endl;
else if(salary>=10001 && salary<14000)
cout<<"Your salary is : RM "<<salaryafterdeduction<<endl;
else if(salary>=14000)
cout<<"Your salary is : RM"<<salaryafterdeduction<<endl;
else
cout<<"Invalid salary.";
return 0;
}

i have done till here but im stuck with how to insert the tax percentage for each salary range
Topic archived. No new replies allowed.