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.
import java.util.Scanner;
public class EmployeeWeeklySalary {
public static void main(String[] args) {
int weeklyHours=0;
Scanner scan =new Scanner(System.in);
System.out.println("Welcome to Emploee's weekly salary!!!");
System.out.println("Please provide how many hours emploee work on this week and press Enter: ");
weeklyHours=scan.nextInt();
if(weeklyHours<=40) {
System.out.println("Thank you.His payed is $65.54.");
}else if(weeklyHours>=40) {
System.out.println("Thank you.His payed is $80.20.");
}
scan.close();
}
}
Comments
Leave a comment