Get the answers you need at Westonci.ca, where our expert community is always ready to help with accurate information. Explore our Q&A platform to find reliable answers from a wide range of experts in different fields. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.
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

We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.