Monday, 27 August 2012

Name-Pratik Panda, Roll no-29725, Assignment Code-CSEL-10x

class Employee
{
public static void main(String[] args)
{
double bsp[4],amount[4];
int hours[4],i,overtime=0;
bsp[0]=7.50;
bsp[1]=8.20;
bsp[2]=10.00;
bsp[3]=7.00;
hours[0]=35;
hours[1]=47;
hours[2]=73;
hours[3]=65;
for(i=0;i<4;i++)
{
if(bsp[i]<8.00)
{
System.out.println("The basic pay of employee "+i+" is less
than $8.00");
}
if(hours[i]<=40 && bsp[i]>=8.00)
{
amount[i]=hours[i]*bsp[i];
}
if(hours[i]>40 && hours[i]<=60 && bsp[i]>=8.00)
{
overtime=hours[i]-40;
amount[i]=(40*bsp[i])+(overtime*bsp[i]*1.5);
}
if(hours[i]>60 && bsp[i]>=8.00)
{
amount[i]=(40*bsp[i])+(20*bsp[i]*1.5);
}
}
for(i=0;i<4;i++)
{
if(bsp[i]>=8.00)
{
System.out.println("The wage of employee "+i+" is Rs."+amount[i]);
}
}
}
}

No comments:

Post a Comment

C Programming

  Table of Contents ​ About the Author 3 ​ Introduction 4 ​ Introduction to Computers 4 1. What is a Computer? 4 2. History...