معتز موسى العتيبي
unknown
plain_text
3 years ago
2.2 kB
6
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 javaapplication8;
import javax.swing.JOptionPane;
/**
*
* @author CTI
*/
public class JavaApplication8 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/*
try {
} catch (Exception e) {
}
*/
int aeg[][]=new int [3][3];
int finsh=60;
String info ="بيانات موظفي الشركة \n";
int AD=0;int B=3;
int aegtotl = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < B; j++) {
try {
do {
aeg[i][j]=Integer.parseInt(JOptionPane.showInputDialog(null,"عمر الموظف رقم"+(j+1)+"في القسم رقم"+(i+1)));
} while (aeg[i][j]>59||aeg[i][j]<18);
} catch (Exception e) {
JOptionPane.showMessageDialog(null,e); }
}
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < B; j++) {
aegtotl+=aeg[i][j];
AD++;
int totl =aeg[i][j];
info+="عمر الموظف رقم "+(j+1)+"هو"+aeg[i][j]+"تبقى له في الخدمة "+""+(finsh-totl)+"سنة";
info+="\n";
// JOptionPane.showMessageDialog(null,"عمر الموظف رقم "+(i+1)+"هو"+aeg[i][j]+"تبقى له في الخدمة "+""+(totl-finsh));
}
info+="عدد الموظفين في الادارة رقم "+(i+1)+"هو"+AD+"مجموع أعمارهم هو"+aegtotl+"متوسط أعمارهم هو "+aegtotl/B;
AD=0;
aegtotl=0;
info+="\n";
info+="\n";
}
JOptionPane.showMessageDialog(null,info);
}
}
Editor is loading...