Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 Zarade;
- /**
- *
- * @author Mladen
- */
- public class NewMain {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- System.out.println("Broj");
- int m=Citaj.Int();
- Zaposleni niz[] = new Zaposleni[m];
- Zaposleni novi;
- char c;
- int i=0;
- do{
- System.out.println("Unesi: n-Nenastavno osoblje, p-Pomocnik direktora");
- c=Citaj.Char();
- if(c=='n')
- novi = new NenastavnoOsoblje();
- else if(c=='p')
- novi = new PomocnikDirektora();
- else novi = null;
- novi.Unos();
- niz[i]=novi;
- i++;
- }
- while(i<m);
- Zaposleni maxSati = niz[0];
- for (int j = 0; j < m; j++) {
- if(maxSati.plata() < niz[i].plata())
- maxSati = niz[j];
- }
- double ukuplata = 0;
- for (int b = 0; b < 10; b++) {
- ukuplata += niz[b].plata();
- }
- double prosek = ukuplata/NenastavnoOsoblje.brojac;
- System.out.println("Najvise radnih sati ima " +maxSati.getIme());
- System.out.println("Procecna plata nnstavnog je"+prosek);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement