Answer to Question #251095 in Java | JSP | JSF for Amadix

Question #251095

Write a program thst calculate and display an employee's weekly salary. if the hours worked are less or equal to 40, the employee is payed N$65.54 per hour, otherwise the employee receives N$80.20 for every hour worked exceeding 40.


1
Expert's answer
2021-10-13T20:25:50-0400
public class Main {
 public static void main(String[] args) {
  display(24);
  display(38);
  display(44);
 }
 public void display(int hours) {
  System.out.println(calcWeeklySalary(hours));
 }
 public double calcWeeklySalary(int hours) {
  if (hours <= 40) return 65.54;
  else return 80.20;
 }
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS