Description:
This program is to compute the salary of an employee, first, you will input the Employee name or your name, then input the hours of work not less than 12, because if it’s less than 12, the output will be invalid. Then it includes the rate of pay that will multiply to the hours of work and deduct the salary Tax.
Program:
import java.io.*;
public class JavaApplication6 {
public static void main(String[] args) throws IOException{
BufferedReader num= new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter Name: ");
String Name = num.readLine();
System.out.print("No. of hours worked: ");
int HoursOfWork= Integer.parseInt(num.readLine());
if(HoursOfWork==12){
double rate = 200.50;
double net = rate*12;
double tax= net*.12;
double tded = tax;
double netpay = net-tded;
System.out.println("Employee name: "+Name);
System.out.println("No of hours work: "+HoursOfWork);
System.out.println("Net Income: "+net);
No comments