Create a simple program that will compute the employees salary.
Program should need the following:
1. Name of the employee.
2. Number of hours work for the week.
3. Number of hours absent.
4. Rate is 180/hour.
5. Compute the weekly salary.
import java.util.*;
class App {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter the Name of the employee:");
String name = keyboard.nextLine();
System.out.print("Enter the Number of hours work for the week: ");
int hours = keyboard.nextInt();
System.out.print("Enter the Number of hours absent: ");
int hoursAbsent = keyboard.nextInt();
int salary = (hours - hoursAbsent) * 180;
System.out.println("The weekly salary: " + salary);
keyboard.close();
}
}
Comments
Leave a comment