Monday, February 16, 2009

Exercise03









#include#include
void main(){ clrscr(); int Salary,Years,Bonus,Sum; printf("\n\tEnter Employe Salary:"); scanf("%d",& Salary);
printf("\n\tEnter Years:"); scanf("%d",& Years);
switch(Years){
case 1: Bonus=0.10*Salary; Sum=Salary+Bonus; printf("\n\tEmployees Bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 2: Bonus=0.20*Salary; Sum=Salary+Bonus; printf("\n\tEmployees Bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 3: Bonus=0.20*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 4: Bonus=0.10*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 5: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 6: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break;
case 7: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 8: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; case 9: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break;
case 10: Bonus=0.50*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\nEmployees will receive a salary of \"P%d\"",Sum); break; } if(Years>=11) { Bonus=0.75*Salary; Sum=Salary+Bonus; printf("\n\tEmployees bonus is \"P%d",Bonus); printf("\n\n\tEmployees will receive a salary of \"P%d\"",Sum); } printf("\n\n\t\tGOOD JOB!! KEEP UP THE GOOD WORK!!! ");
getch();}

No comments:

Post a Comment