----------------------
android培训、
java培训、期待与您交流! ----------------------
---------------------- android培训、 java培训、期待与您交流! ----------------------详细请查看: http://edu.csdn.net/heima
小银行业务调度系统
看过张老师的银行业务调度程序,受益匪浅啊,并自我感觉太轻松了,但当自己做的时候,发现是那么的困难,于是乎,就想出了小银行业务调度系统。
1、 小银行不需要快速窗口,也没有单独的VIP窗口,一般为3个窗口,但为了以后发展,不应该在程序里写死。
2、有三种对应类型的客户:VIP客户,普通客户,快速客户(办理如交水电费、电话费之类业务的客户)。每种客户分别类型的号码进行区分:普遍客户,A开头;VIP,V开头;快速,K开头。
3、 号码根据叫号员的操作生成,不同客户生成不同代码。
4、 业务办理优先级V>A>K,同类型客户按顺序依次办理。
5、 当窗口处理业务时,对窗口进行锁定。
模拟一下叫号员的操作:
import myBank.CustomerType;
public class MyBank {
public static void main(String[] args) throws InterruptedException {
int j = 1;
do {
j++;
//System.out.println(simulateOperator());
ServiceWindow window = new ServiceWindow();
window.start(simulateOperator());
} while (j <= 20);
}
public static CustomerType simulateOperator() throws InterruptedException {
CustomerType type = CustomerType.COMMON;
int i = (int) Math.random() * 100;
Thread.sleep(5000);// 每5秒一位客户
if (i > 60 & i < 90) {
type = CustomerType.EXPRESS;
} else if (i > 90) {
type = CustomerType.VIP;
}
return type;
}
}
ServiceWindow有点小改动,
其他代码基本不用改动
---------------------- android培训、 java培训、期待与您交流! ----------------------详细请查看: http://edu.csdn.net/heima