package alx.p31_streamy.emps;

import java.util.List;

public class P4_SredniaJob_v1 {

	public static void main(String[] args) {
		List<Employee> emps = ObslugaCSV.wczytaj("emps.csv");
		
		double srednia = emps.stream()
			.filter(emp -> "Programmer".equals(emp.getJobTitle()))
			.mapToInt(Employee::getSalary)
			.average()
			.getAsDouble();
		
		System.out.println("Średnia programistów: " + srednia);
	}

}
