Answer to Question #320941 in Java | JSP | JSF for miaka

Question #320941

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.

1
Expert's answer
2022-03-30T07:39:48-0400


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();
	}
}

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