The employee list for a company contains employee code, name, designation and basic pay. The employee is given HRA of 10% of the basic and DA of 45% of the basic pay. The total pay of the employee is calculated as Basic pay+HRA+ DA. Write a class to define the details of the employee. Write a constructor to assign the required initial values. Add a method to calculate HRA, DA and Total pay and print them out. Write another class with a main method. Create objects for three different employees and calculate the HRA, DA and total pay.


0

class Employee {
int employeeCode;
String name;
String designation;
double basicPay;
double hra;
double da;
double totalPay;


}

public class Main {
public static void main(String[] args) {
// Creating objects for three different employees
Employee employee1 = new Employee(101, "John Doe", "Manager", 50000.0);
Employee employee2 = new Employee(102, "Jane Smith", "Engineer", 40000.0);
Employee employee3 = new Employee(103, "Alice Johnson", "Analyst", 30000.0);


}