#include<stdio.h>
#include<string.h>
int main(){
char gender[10];
char Qualifications[20] ;
int YearOfService ;
int Salary ;
printf("Enter gender. In this format: Female or Male\n");
scanf("%s", &gender);
printf("Enter year of service\n");
scanf("%d", &YearOfService);
printf("Enter Qualifications. In this format: Post-Graduate or Graduate\n");
scanf("%s", &Qualifications);
if((strcmp(gender,"Male") == 0) && YearOfService>= 10 && (strcmp(Qualifications,"Post-Graduate") == 0)){
printf("The salary is: $ 15,000");
}
else if((strcmp(gender,"Male") == 0) && YearOfService>= 10 && (strcmp(Qualifications,"Graduate") == 0)){
printf("The salary is: $ 10,000");
}
else if((strcmp(gender,"Male") == 0) && YearOfService<10 && (strcmp(Qualifications,"Post-Graduate") == 0)){
printf("The salary is: $ 10,000");
}
else if((strcmp(gender,"Male") == 0) && YearOfService<10 && (strcmp(Qualifications,"Graduate") == 0)){
printf("The salary is: $ 7,000");
}
else if((strcmp(gender,"Female") == 0) && YearOfService>=10 && (strcmp(Qualifications,"Post-Graduate") == 0)){
printf("The salary is: $ 12,000");
}
else if((strcmp(gender,"Female") == 0) && YearOfService>=10 && (strcmp(Qualifications,"Graduate") == 0)){
printf("The salary is: $ 9,000");
}
else if((strcmp(gender,"Female") == 0) && YearOfService<10 && (strcmp(Qualifications,"Post-Graduate") == 0)){
printf("The salary is: $ 10,000");
}
else if((strcmp(gender,"Female") == 0) && YearOfService<10 && (strcmp(Qualifications,"Graduate") == 0)){
printf("The salary is: $ 6,000");
}
}
Comments
Leave a comment