Advertisement
Guest User

Salary Estimation based on age and experience

a guest
Oct 23rd, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>      
  2. using namespace std;    
  3. int main()    
  4. {    
  5.    int salary, exp, age;    
  6.    cout<<"\n Is the person experienced ? Enter 1 for yes, 0 for no : ";    
  7.    cin>>exp;    
  8.    cout<<"\n Enter age of the person : ";  
  9.    cin>>age;  
  10.        
  11.     ///{ Write your code here    
  12.     ///
  13.      
  14.      if(exp == 1 && age >=35 ){
  15.          salary = 6000;
  16.      }
  17.      else if(exp == 1 && age >=28 && exp == 1 && age <=35 ){
  18.          salary = 4000;
  19.      }
  20.      else if(exp == 0 || exp == 1 && age <=28){
  21.          salary = 2000;
  22.      }
  23.      else {
  24.          salary = 0;
  25.      }
  26.      
  27.      
  28.      
  29.      
  30.      
  31.      
  32.      
  33.     ///}    
  34.      
  35.    
  36.    cout<<"\n The salary of the person is "<<salary;
  37.        
  38.    return 0;    
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement