ahmed omier almoallemi
unknown
plain_text
3 years ago
1.8 kB
4
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 ahmed.omier.almoallemi; import javax.swing.JOptionPane; /** * * @author CTI */ public class AhmedOmierAlmoallemi { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int a=Integer.parseInt(JOptionPane.showInputDialog("ادخل عدد الموظفين")); int b=3; int c[][]=new int[b][a]; int sum=0,avg=0,total=0; int d=60; for (int i = 0; i < c.length; i++) { JOptionPane.showMessageDialog(null,"ادخل عمر الموظف" + (1+i)); for (int j = 0; j <c[i].length; j++) { c[i][j]=Integer.parseInt(JOptionPane.showInputDialog("ادخل عمر الموظف رقم"+(1+j))); if (c[i][j] >18 && c[i][j] <60) sum+=c[i][j]; total=c[i][j]; d-=c[i][j]; avg=sum/a; System.out.println(" عمر الموظف رقم"+(1+i)+"="+total + "-----"+"وتبقى له في الخدمة "+ "=" +d); sum=0; avg=0; d=0; total=0; } { System.out.println("عدد الموظفين في الادارة" + "-----"+total ); System.out.println("مجموع الاعمار " + "-----"+sum ); System.out.println("متوسط الاعمار " + "-----"+avg/a ); } } } }
Editor is loading...