Answer to Question #247566 in Java | JSP | JSF for Nelly

Question #247566

Write a program that calculate and displays 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-06T10:00:29-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