Commit ccc62f43 authored by Magnus Schjølberg's avatar Magnus Schjølberg
Browse files

Add boilerplate for exercise lecture 6

parent 39f31c3f
package of6.delegation.kode;
public class Employee {
private String name;
private String role;
public Employee(String name, String role) {
this.name = name;
this.role = role;
}
public String getName() {
return name;
}
public String getRole() {
return role;
}
}
public static void main(String[] args) {
CallCenter callCenter = new CallCenter();
List<Employee> employeeList = List.of(
new Employee("Børge", "Teamleder"),
new Employee("Magnus", "Junior"),
new Employee("Nora", "Junior"),
new Employee("Jostein", "Junior"),
new Employee("Mattias", "Teamleder"),
new Employee("Eirik", "HR"));
employeeList.forEach(employee -> callCenter.addEmployee(employee));
callCenter.answerCall("klage");
callCenter.answerCall("klage");
callCenter.answerCall("internt");
callCenter.answerCall("eskalering");
callCenter.answerCall("spørsmål");
callCenter.answerCall("klage");
callCenter.answerCall("eskalering");
callCenter.answerCall("spørsmål");
callCenter.answerCall("spørsmål");
employeeList.forEach(
employee -> System.out.println(employee.getName() + " " + employee.getNumberOfCallsAnswered()));
}
\ No newline at end of file
public static void main(String[] args) {
Phone iPhone11Pro = new Phone("Magnus sin iPhone");
Phone SamsungGalaxy = new Phone("Kjetils Android");
App OOPmini = new App();
App OOPbank = new App();
iPhone11Pro.install(OOPmini);
iPhone11Pro.install(OOPbank);
SamsungGalaxy.install(OOPmini);
OOPmini.sendPushNotification("Nå har vi 40% rabatt på Hummus!");
System.out.println(iPhone11Pro.printPushNotifications());
System.out.println();
System.out.println(SamsungGalaxy.printPushNotifications());
System.out.println();
OOPbank.sendPushNotification("Søk om høyere kredittgrense idag!");
System.out.println(iPhone11Pro.printPushNotifications());
System.out.println();
System.out.println(SamsungGalaxy.printPushNotifications());
}
Supports Markdown
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