ABDULAZIZ ALBOGOMI
unknown
plain_text
3 years ago
1.6 kB
5
Indexable
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication18;
/**
*
* @author CTI
*/
import javax.swing.JOptionPane;
public class JavaApplication18 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int dep=Integer.parseInt(JOptionPane.showInputDialog("enter the number of department "));
int N=Integer.parseInt(JOptionPane.showInputDialog("enter the number of staff "));
int total=0,avg=0;
int a[][]=new int[N][dep];
try{ //لم استطيع ادخال الكود
}
catch(Exception e){
System.out.print(e);
}
for (int i = 0; i < a.length; i++) {
JOptionPane.showInputDialog("enter the age of the worker NUMBER " + (i+1));
if (i >60 | i<18) JOptionPane.showMessageDialog(null,"enter a vaid number ");
for (int j = 0; j < a[i][j]; j++) {
JOptionPane.showInputDialog("enter the age of the client ");
total+=a[i][j];
avg=total/N;
System.out.print("age of client " +N+ "is" + i + "the total is " +total + "the avrage is " +avg);
}
}
}
}
Editor is loading...