Answer to Question #175109 in C++ for KAVIN MUKILAN

Question #175109

In a company an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input by the user write a program to find his gross salary.


1
Expert's answer
2021-03-25T04:20:30-0400
#include <iostream> 
using namespace std;
 
int main() {
  float base_s, gross_s, DA, HRA;
  cout<<"Please entered basic salary (In Rs.): ";
  cin>>base_s;
  
  if (base_s < 500) {
      HRA = base_s * 10 / 100;
      DA = base_s * 90 / 100;
  }
  else {
      HRA = 500;
      DA = base_s * 98 / 100;
                       }
  gross_s = base_s + HRA + DA;
  
  // Display result
  cout<<"Basic Salary Rs. "<<base_s<<endl;
  cout<<"HRA Rs. "<< HRA <<endl;
  cout<<"DA Rs. "<< DA<<endl;
  cout<<"Gross salary Rs. " << gross_s<<endl;
  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

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS