##
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class Employee{ | |
public static void main(String args[]){ | |
Scanner sc = new Scanner(System.in); | |
Scanner inty = new Scanner(System.in); | |
String emp_name[] = new String[3]; | |
int emp_salary[] = new int[3]; | |
int emp_id[] = new int[3]; | |
int tax = 7; | |
int en = 2; | |
String emp_post[] = new String[3]; | |
double total_groce_sallary; | |
for(int i = 0; i <= 2; i++){ | |
System.out.println("\n Enter Details Employee: "+(i+1)); | |
System.out.print("Enter Emplyee ID: "); | |
emp_id[i] = sc.nextInt(); | |
System.out.print("Enter Employee Name: "); | |
emp_name[i] = inty.nextLine(); | |
System.out.print("Enter Employee Salary: "); | |
emp_salary[i] = sc.nextInt(); | |
System.out.print("Enter Employee Post: "); | |
emp_post[i] = inty.nextLine(); | |
} | |
for(int j = 0; j <=2; j++){ | |
double total_tax = (emp_salary[j]*7)/100; | |
double total = emp_salary[j] - total_tax; | |
double extara_add = (emp_salary[j]*2)/100; | |
double gross_salary = total+extara_add; | |
System.out.println(" \n Emplyee Details:"+(j+1)); | |
System.out.println(" Emplyee ID: "+emp_id[j]); | |
System.out.println(" Employee Name: "+emp_name[j]); | |
System.out.println(" Employee post: "+emp_post[j]); | |
System.out.println(" Employee salary: "+emp_salary[j]); | |
System.out.println(" Employee tax : "+total_tax); | |
System.out.println(" En : "+extara_add); | |
System.out.println(" without tax in salary : "+total_tax); | |
System.out.println("Total Gross Salary: "+gross_salary); | |
System.out.println("***************"); | |
} | |
} | |
} |