结队成员:朱民福,李遇塘。
李遇塘的博客地址:http://home.cnblogs.com/u/Liyutang/
成员照片:
现有一新建办公大厦,共有21层,共有四部电梯,所有电梯基本参数如下表所示:
|
电梯编号 |
可服务楼层 |
最大乘客数量 |
最大载重量 |
|
1 |
全部楼层 |
10 |
800 kg |
|
2 |
单层 |
10 |
800 kg |
|
3 |
双层 |
20 |
1600 kg |
|
4 |
全部楼层 |
20 |
2000 kg |
其使用规定如下:
1、楼层号为0~20,其中0号为地下一层;
2、有楼层限制的电梯不在响应楼层停靠,如单双层;
3、所有电梯采用统一按钮控制
请根据上述要求设计并实现一个电梯控制程序,如果有图形显示就更好了。
程序分析
首先运行,中间的textbox显示电梯的初始楼层,下边的button是用户所在楼层,最上边的是选择使用的电梯号。
假设人在15层,点击15,电梯是向上走的,置or为0。
public static class quanju { public static int flot = 0;//dianti suo zai louceng! public static int flag = 0;//运行状态 public static int num_flot = 0; public static int or = 2;//0为上!1为下!2为静止 public static int flot1 = 0; public static int flot2 = 0; public static int flot3 = 2; public static int flot4 = 0; }