Monday, November 23, 2020

Assignment of CS201

 #include<iostream>

using namespace std;
int main()
{
    int no_emplyes=10,sal_level_a=125000,sal_level_b=80000,sal_level_c=45000;
    int tax_level_a,tax_level_b,tax_level_c,total_tax_level_a,total_tax_level_b,total_tax_level_c;
    int net_sal_level_a,net_sal_level_b,net_sal_level_c,total_pay;
    int anual_sal_level_a,anual_sal_level_b,anual_sal_level_c;
    int wal_fund=600,total_tax;
    int total_walfare=no_emplyes*wal_fund;
    int opt;
    
    anual_sal_level_a=sal_level_a*12;
    anual_sal_level_b=sal_level_b*12;
    anual_sal_level_c=sal_level_c*12;

    if(anual_sal_level_a>600000){
        tax_level_a=sal_level_a*1/100;
    }
    else
    {
        tax_level_a=0;
    }
    total_tax_level_a=tax_level_a*2;

    if(anual_sal_level_b>600000){
        tax_level_b=sal_level_b*1/100;
    }
    else
    {
        tax_level_b=0;
    }
    total_tax_level_b=tax_level_b*3;

    if(anual_sal_level_c>600000){
        tax_level_c=sal_level_c*1/100;
    }
    else
    {
        tax_level_c=0;
    }
    total_tax_level_c=tax_level_c*5;

    total_tax=total_tax_level_a+total_tax_level_b+total_tax_level_c;

    net_sal_level_a=sal_level_a-tax_level_a-wal_fund;
    net_sal_level_b=sal_level_b-tax_level_b-wal_fund;
    net_sal_level_c=sal_level_c-tax_level_c-wal_fund;
    total_pay=net_sal_level_a+net_sal_level_b+net_sal_level_c;

    //Output
    cout<<"The amout of tax that detect for all employess: "<<total_tax<<endl;
    cout<<"Total amount of welfare fund collected each month from all employees: "<<total_walfare<<endl;
    cout<<"Net monthly salary of lavel A employess: "<<net_sal_level_a<<endl;
    cout<<"Net monthly salary of lavel B employess: "<<net_sal_level_b<<endl;
    cout<<"Net monthly salary of lavel C employess: "<<net_sal_level_c<<endl;
    cout<<"Total amount which organization pays to its employees each month: "<<total_pay<<endl;

    //Menu
    cout<<"Enter 1 to know the tax collect of level A employess"<<endl;
    cout<<"Enter 2 to know the tax collect of level B employess"<<endl;
    cout<<"Enter 3 to know the tax collect of level C employess"<<endl;
    cin>>opt;

    if(opt==1){
        cout<<"Tax collect of level A employess is: "<<total_tax_level_a<<endl;
    }
    else if(opt==2){
        cout<<"Tax collect of level B employess is: "<<total_tax_level_b<<endl;
    }
    else if(opt==3){
        cout<<"Tax collect of level C employess is: "<<total_tax_level_c<<endl;
    }
    else
    {
        cout<<"Invaild input"<<endl;
    }
    
    




 
    return 0;
}

No comments:

Post a Comment