Computer Science, asked by sristi80, 11 months ago

Please write a Java program for the following....

Attachments:

rakeshchennupati143: mark brainliest of you liked it

Answers

Answered by rakeshchennupati143
1

Program:

import java.io.*;

import java.util.*;

class Employee{

     public String name;

     public int basic,hra,da,pf,pt,net;

     public void display(){

           System.out.print("\nEmployee Details\nEmployee Name : "+name+"\nEmployee's Basic Salary :"+basic+"\nEmployee's house rent allowance : "+hra+"\nEmployee's dearness allowance : "+da+"\nEmployee's provident fund : "+pf+"\nEmployee's professional tax : "+pt+"\nEmployee's Net Salary payable : "+net);

     }

}

public class Main{

     public static void main(String args[]){

           Scanner sc = new Scanner(System.in);

           Employee e = new Employee();

           System.out.println("Enter Employee Name");

           Scanner sc = new Scanner(System.in);

           Employee e = new Employee();

           System.out.println("Enter Employee Name");

           e.name = sc.nextLine();

           System.out.println("Enter Employess Basic Salary");

           e.basic = sc.nextInt();

           System.out.println("Enter Employee's house rent allowance");

           e.hra = sc.nextInt();

           System.out.println("Enter Employee's dearness allowance");

           e.da = sc.nextInt();

           System.out.println("Enter Employee's provident fund");

           e.pf = sc.nextInt();

           System.out.println("Enter Employee's professional tax");

           e.pt = sc.nextInt();

           System.out.println("Enter Employess's Net Salary Payable");

           e. net = sc.nextInt();

           e.display();

}

}

Output:

Enter Employee Name

employee_1

Enter Employess Basic Salary

100000

Enter Employee's house rent allowance

2000

Enter Employee's dearness allowance

2000

Enter Employee's provident fund

5000

Enter Employee's professional tax

3000

Enter Employess's Net Salary Payable

88000

Employee Details

Employee Name : employee_1

Employee's Basic Salary :100000

Employee's house rent allowance : 2000

Employee's dearness allowance : 2000

Employee's provident fund : 5000

Employee's professional tax : 3000

Employee's Net Salary payable : 8800

---Hope you understood my program,if you liked it mark as brainliest,it would really help me  :)

Similar questions