Answer to Question #221982 in C++ for Bismark

Question #221982

A c++ program to compute the net salary of an employee with the following

Basic salary

Transport allowance 15% from the basic salary

Housing allowance is 8% from the basic salary

if the basic salary is more than 500 then,

the launch allowance is 5% of the basic salary. Gross allowance is equal to basic salary, transport allowance and housing allowance

tax is 6%

Total deduction is Gross allowance minus tax

Net Salary is?


1
Expert's answer
2021-08-01T00:29:21-0400


#include <iostream>


using namespace std;


int main()
{
    int basic_salary;
    cout<<"\nEnter basic salary: ";
    cin>>basic_salary;
    int transport_allowance=0.15*basic_salary;
    int housing_allowance=0.08*basic_salary;
    int launch_allowance;
    int gross_allowance;
    int transport_allowance_tax;
    int housing_allowance_tax;
    int net_salary=basic_salary+transport_allowance+housing_allowance;
    if (basic_salary>500){
        launch_allowance=0.05*basic_salary;
        gross_allowance=basic_salary;
        transport_allowance_tax=0.06*transport_allowance;
        housing_allowance_tax=0.06*housing_allowance;
        net_salary=basic_salary+housing_allowance+transport_allowance+launch_allowance-(transport_allowance_tax+housing_allowance_tax);
    }
    cout<<"\nNet salary = "<<net_salary;
    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

Assignment Expert
05.08.21, 13:57

Dear Bismark, please pay attention the code works well


Bismark
05.08.21, 13:13

The codes didn't work out. At the of the codes. At the the Net salary wasn't calculated.

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS