//Calculate overtime
import java.util.Scanner;
public class Overtime {
public static void main(String args[])
{
int e[]=new int[10],o[]=new int[10],i;
Scanner sc=new Scanner(System.in);
System.out.println("Enter overtime hrs for 10 employees:");
for(i=0;i<10;i++)
e[i]=sc.nextInt();
System.out.println("Overtime Pay for 10 employees");
{
for(i=0;i<10;i++)
{
if(e[i]>40)
o[i]=(e[i]-40)*12;
else
o[i]=0;
System.out.println("Employee No:"+(i+1)+" Overtime pay:Rs."+o[i]);
}
}
}
}
import java.util.Scanner;
public class Overtime {
public static void main(String args[])
{
int e[]=new int[10],o[]=new int[10],i;
Scanner sc=new Scanner(System.in);
System.out.println("Enter overtime hrs for 10 employees:");
for(i=0;i<10;i++)
e[i]=sc.nextInt();
System.out.println("Overtime Pay for 10 employees");
{
for(i=0;i<10;i++)
{
if(e[i]>40)
o[i]=(e[i]-40)*12;
else
o[i]=0;
System.out.println("Employee No:"+(i+1)+" Overtime pay:Rs."+o[i]);
}
}
}
}
No comments:
Post a Comment