Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package Zarade;
  7.  
  8. /**
  9.  *
  10.  * @author Mladen
  11.  */
  12. public class NewMain {
  13.  
  14.     /**
  15.      * @param args the command line arguments
  16.      */
  17.     public static void main(String[] args) {
  18.         System.out.println("Broj");
  19.         int m=Citaj.Int();
  20.         Zaposleni niz[] = new Zaposleni[m];
  21.         Zaposleni novi;
  22.         char c;
  23.         int i=0;
  24.        
  25.         do{
  26.             System.out.println("Unesi: n-Nenastavno osoblje, p-Pomocnik direktora");
  27.             c=Citaj.Char();
  28.             if(c=='n')
  29.                 novi = new NenastavnoOsoblje();
  30.             else if(c=='p')
  31.                 novi = new PomocnikDirektora();
  32.             else novi = null;
  33.            
  34.             novi.Unos();
  35.             niz[i]=novi;
  36.             i++;
  37.            
  38.         }
  39.         while(i<m);
  40.        
  41.        
  42.        
  43.         Zaposleni maxSati = niz[0];
  44.         for (int j = 0; j < m; j++) {
  45.             if(maxSati.plata() < niz[i].plata())
  46.                 maxSati = niz[j];
  47.         }
  48.        
  49.         double ukuplata = 0;
  50.        
  51.         for (int b = 0; b < 10; b++) {
  52.                 ukuplata += niz[b].plata();
  53.             }
  54.        
  55.        
  56.         double prosek = ukuplata/NenastavnoOsoblje.brojac;
  57.        
  58.         System.out.println("Najvise radnih sati ima " +maxSati.getIme());
  59.         System.out.println("Procecna plata nnstavnog je"+prosek);
  60.        
  61.     }
  62.    
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement