Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 39c39c2

Browse files
author
cd155
committed
add OO parts
1 parent 8422c62 commit 39c39c2

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

‎src/OODesign/CallCenter/Employee.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package CallCenter;
2+
3+
// 7.2
4+
// Imagine you have a call center with three levels of employees:
5+
// respondent, manager, and director. An incoming telephone call must be
6+
// first allocated to a respondent who is free. If the respondent can't
7+
// handle the call, he or she must escalate the call to a manager. If the
8+
// manager is not free or not able to handle it, then the call should be
9+
// escalated to a director. Design the classes and data structures for
10+
// this problem. Implement a method dispatchCall() which assigns a call
11+
// to the first available employee.
12+
13+
// class employee:
14+
// property:
15+
// levelType
16+
// isAvailable
17+
// nextLevel
18+
// callNumber
19+
20+
// function:
21+
// signCall()
22+
// completeCall()
23+
24+
25+
// static method:
26+
// dispatchCall([respondent], call)
27+
// 1. find the first available respondent, sign a call
28+
// or 2. find the first available manager, sign a call
29+
// or 3. find the first available director, sign a call
30+
31+
// getFirstResp([respondent]) -> a list of employee
32+
33+
// getFirstManager([respondent]) -> a list of employee
34+
35+
// getFirstDirector([respondent]) -> a list of employee
36+
37+
// check Resp, manage, director, to find the first one
38+
39+
public class Employee
40+
{
41+
private String levelType;
42+
private Boolean isAvailable;
43+
private Employee supervisor;
44+
private String callNumber;
45+
46+
public String name;
47+
48+
public Employee()
49+
{
50+
levelType = "";
51+
isAvailable = false;
52+
supervisor = null;
53+
callNumber = "";
54+
}
55+
56+
public void signedCall(String callNumber)
57+
{
58+
this.callNumber = callNumber;
59+
isAvailable = false;
60+
}
61+
62+
public void completeCall()
63+
{
64+
this.callNumber = null;
65+
isAvailable = false;
66+
}
67+
}

‎src/OODesign/CallCenter/callFunc.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package CallCenter;
2+
import java.util.*;
3+
4+
public class callFunc {
5+
public static void dispatchCall(List<Employee> respondents)
6+
{
7+
8+
};
9+
10+
private static Employee[] getFirstResp(List<Employee> respondents)
11+
{
12+
List<Employee> potEmp = new ArrayList<Employee>();
13+
for (Employee emp: respondents)
14+
{
15+
16+
}
17+
return new Employee[0];
18+
};
19+
20+
private static Employee[] getFirstManager(List<Employee> respondents)
21+
{
22+
return new Employee[0];
23+
};
24+
25+
private static Employee[] getFirstDirector(List<Employee> respondents)
26+
{
27+
return new Employee[0];
28+
};
29+
}

‎src/OODesign.txt renamed to ‎src/OODesign/OODesign.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ static method:
6767
1. find the first available respondent, sign a call
6868
or 2. find the first available manager, sign a call
6969
or 3. find the first available director, sign a call
70+
71+
getFirstResp([respondent]) -> a list of employee
72+
73+
getFirstManager([respondent]) -> a list of employee
74+
75+
getFirstDirector([respondent]) -> a list of employee
76+
77+
check Resp, manage, director, to find the first one

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /