Employee Rate
CyberCodes :: COMMUNITY :: Computer and Internet Zone :: Programming :: JAVA
Page 1 of 1
Employee Rate
Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate.
Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay
Try to Run This
import java.util.*;
import java.io.*;
public class Exer05
{
public static void main(String[]args)throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner scan = new Scanner ( System.in);
int num;
String LN;
String FN;
int Worked,Rate;
System.out.print("Enter Employee Number: ");
num = scan.nextInt();
System.out.print("Enter Employee Family Name: ");
LN = br.readLine();
System.out.print("Enter Given Name: ");
FN = br.readLine();
System.out.print("Enter Hours Worked: ");
Worked = scan.nextInt();
System.out.print("Enter Rate Per Hour: ");
Rate = scan.nextInt();
int gross;
gross = +Worked * +Rate;
System.out.println("Gross Pay:" +gross);
double SSS;
SSS = +gross * .05;
System.out.println("SSS Deduction:" +SSS);
double Tax;
Tax = +gross * .10;
System.out.println("Tax Withhold:" +Tax);
double Total;
Total = +SSS + +Tax;
System.out.println("Total Deduction:" +Total);
}
}
Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay
Try to Run This
import java.util.*;
import java.io.*;
public class Exer05
{
public static void main(String[]args)throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner scan = new Scanner ( System.in);
int num;
String LN;
String FN;
int Worked,Rate;
System.out.print("Enter Employee Number: ");
num = scan.nextInt();
System.out.print("Enter Employee Family Name: ");
LN = br.readLine();
System.out.print("Enter Given Name: ");
FN = br.readLine();
System.out.print("Enter Hours Worked: ");
Worked = scan.nextInt();
System.out.print("Enter Rate Per Hour: ");
Rate = scan.nextInt();
int gross;
gross = +Worked * +Rate;
System.out.println("Gross Pay:" +gross);
double SSS;
SSS = +gross * .05;
System.out.println("SSS Deduction:" +SSS);
double Tax;
Tax = +gross * .10;
System.out.println("Tax Withhold:" +Tax);
double Total;
Total = +SSS + +Tax;
System.out.println("Total Deduction:" +Total);
}
}
princeterror- Universal Moderator
- Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 33
CyberCodes :: COMMUNITY :: Computer and Internet Zone :: Programming :: JAVA
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum