60 403
Assignments Done
98,2%
Successfully Done
In April 2018

Answer to Question #56627 in Java | JSP | JSF for Lindoln Noah Garcia

Question #56627
1. 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
Expert's answer
/*
* Program's input: Employee Name, Rate per hour, No. of hours worked.
* This program calculate the daily wage of an employee.
*/
package employee;

import java.util.Scanner;

public class Employee {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double DailyWage = 0, otPay = 0;

System.out.println("Please, enter Employee Name");
String name = sc.nextLine();
System.out.println("Please, enter Rate per hour");
int rate = Integer.parseInt(sc.nextLine());
System.out.println("Please, enter No. of hours");
int hours = Integer.parseInt(sc.nextLine());
if (hours>8)
otPay = (hours-8)*0.3*rate;
DailyWage = rate*hours + otPay;
System.out.println("=========================");
System.out.println(name + " daily wage - " + DailyWage);

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions