Get detailed and reliable answers to your questions on IDNLearn.com. Discover the information you need from our experienced professionals who provide accurate and reliable answers to all your questions.
Sagot :
[tex]\large\bold{\underline{\underline{Program :}}}[/tex]
#include<iostream>
using namespace std;
int main ()
{
float basic, gross, da, hra;
cout<<"Enter basic salary of an employee:";
cin>>basic;
if (basic <25000)
{
da = basic *80/100;
hra = basic *20/100;
}
else if (basic >=25000 & & basic<40000)
{
da = basic *90/100;
hra = basic *25/100;
}
else if (basic>=40000)
{
da = basic *95/100;
hra = basic *30/100;
}
gross = basic + hra + da;
cout<<"\n\t Basic Pay............" <<basic<<endl;
cout<<"\t Dearness Allowance..........." <<da<<endl;
cout<<"\t House Rent Allowance......" <<hra<<endl;
cout<<"\t Gross Salary............." <<gross<<endl;
cout<<"\t - - - - - - - - - - - - - - -" <<endl;
[tex]\large\bold{\underline{\underline{Output :}}}[/tex]
Enter Basic Salary of an employee : 25000
Basic Pay : 25000
Dearness Allowance : 22500
House Rent Allowance : 6250
Gross Salary : 53750
[tex]\large\bold{\underline{\underline{Result :}}}[/tex]
The Expected Output is archived
Using the knowledge of code in c++ we have to be the same as the attached image.
In a simpler way, we have that this code can be described as:
#include<iostream>
using namespace std;
int main ()
{
float basic, gross, da, hra;
cout<<"Enter basic salary of an employee:";
cin>>basic;
if (basic <25000)
{
da = basic *80/100;
hra = basic *20/100;
}
else if (basic >=25000 & & basic<40000)
{
da = basic *90/100;
hra = basic *25/100;
}
else if (basic>=40000)
{
da = basic *95/100;
hra = basic *30/100;
}
gross = basic + hra + da;
cout<<"\n\t Basic Pay............" <<basic<<endl;
cout<<"\t Dearness Allowance..........." <<da<<endl;
cout<<"\t House Rent Allowance......" <<hra<<endl;
cout<<"\t Gross Salary............." <<gross<<endl;
cout<<"\t - - - - - - - - - - - - - - -" <<endl;
See more about C++ code at brainly.com/question/25870717
Thank you for being part of this discussion. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. IDNLearn.com is dedicated to providing accurate answers. Thank you for visiting, and see you next time for more solutions.