Monday, February 16, 2009

EXER 7











#include
#include
#define cp cprintf#define s scanffloat salary, years, bonus;void main(){clrscr();gotoxy(25,9);textcolor(YELLOW);cp("Enter Salary: P");s("%f", &salary);gotoxy(25,10);textcolor(YELLOW);cp("\nEnter Years of Service: ");s("%f", &years);bonus=0;if (years==1){bonus=salary*0.10;gotoxy(25,12);textcolor(YELLOW);cp("\nBonus: P%.2f", bonus);}else if ((years<=5) && (years>=2)){bonus=salary*0.20;gotoxy(25,12);textcolor(YELLOW);cp("\nBonus: P%.2f", bonus);}else if ((years<=10) && (years>=6)){bonus=salary*0.50;gotoxy(25,12);textcolor(YELLOW);cp("\nBonus: P%.2f", bonus);}else if (years>=11){bonus=salary*0.75;gotoxy(25,12);textcolor(YELLOW);cp("\nBonus: P%.2f", bonus);}getch();}

No comments:

Post a Comment