Ali jamaan Ali

 avatar
unknown
plain_text
2 years ago
1.4 kB
2
Indexable
int EmployeeNo=Integer.parseInt(JOptionPane.showInputDialog("Enter the employee Number "));
        int DeprtmenNo=Integer.parseInt(JOptionPane.showInputDialog("Enter Number of Deprtment"));
        double age[][]=new double [EmployeeNo] [DeprtmenNo];
        
        try{
        for (int i = 0; i < EmployeeNo; i++) {
            for (int j = 0; j < DeprtmenNo; j++) {
              age[j][i]=Double.parseDouble(JOptionPane.showInputDialog("Enter the Age of the employee"+(i+1)));
            }  
        }
        }
        catch(Exception ex){
            System.err.println("Invale Input");
            System.exit(1);
        }
        
        for (int i = 0; i < EmployeeNo; i++) {
            double totalAge=0;
            double agraAge=0;
            for (int j = 0; j < totalAge; j++) {
                totalAge+=age[i][j];
                if(age[i][j]>agraAge){
                    agraAge=age[i][j];
                }
                System.out.println("Total of Employee number In deprtment"+(i+1)+EmployeeNo);
                System.out.println("The Total of employee Age is :" +(i+1)+totalAge);
                System.out.println("The avarage The Total of employee Age is :"+(i+1)+agraAge/EmployeeNo);
                
            }
            System.out.println(", ");
        }
         
    }
    
}
Editor is loading...