package emps;

import java.util.List;

public class P5_MinMax_v3 {

	public static void main(String[] args) {
		List<Employee> emps = ObslugaCSV.wczytaj();
		if(emps.isEmpty()) {
			System.out.println("Brak danych");
			System.exit(1); // zakończenie procesu z podanym kodem
		}
		Employee max = emps.get(0);
		Employee min = emps.get(0);
		
		for(Employee emp : emps) {
			if(emp.getSalary() > max.getSalary()) {
				max = emp;
			}
			if(emp.getSalary() < min.getSalary()) {
				min = emp;
			}
		}
		
		System.out.println("max: " + max);
		System.out.println("min: " + min);
	}

}
