Commit c1cb608d by Patryk Czarnik

P1 P2

parent 44e088db
package emps;
import java.util.List;
public class P1_WypiszWybranePola {
public static void main(String[] args) {
List<Employee> emps = ObslugaCSV.wczytaj("emps.csv");
// Dla każdego pracownika wypisz imię, nazwisko i pensję
// np.: Steven King zarabia 24000
for (Employee emp : emps) {
System.out.println(emp.getFirstName() + " " + emp.getLastName() + " zarabia " + emp.getSalary());
}
}
}
package emps;
import java.util.List;
public class P2_WypiszBogatych {
public static void main(String[] args) {
List<Employee> emps = ObslugaCSV.wczytaj("emps.csv");
for(Employee emp : emps) {
if(emp.getSalary() >= 10_000) {
System.out.printf("Pracownik %s %s (%s) zarabia %d\n", emp.getFirstName(), emp.getLastName(), emp.getJobTitle(), emp.getSalary());
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment