中级软件设计师下半年下午试题.docx
- 文档编号:11378855
- 上传时间:2023-02-28
- 格式:DOCX
- 页数:16
- 大小:207.65KB
中级软件设计师下半年下午试题.docx
《中级软件设计师下半年下午试题.docx》由会员分享,可在线阅读,更多相关《中级软件设计师下半年下午试题.docx(16页珍藏版)》请在冰豆网上搜索。
中级软件设计师下半年下午试题
图2 0层数据流图
1、根据说明中的词语,给出图1中的实体E1~E2的名称。
2、根据说明中的词语,给出图2中的数据存储D1~D5的名称。
3、根据说明中的词语,补充图2中缺失的数据流及其起点和终点。
试题二
阅读下列说明,回答下列问题。
[说明]
某集团公司在全国不同城市拥有多个大型超市,为了有效管理各个超市的业务工作,需要构建一个超市信息管理系统。
[需求分析结果]
4超市信息包括:
超市名称、地址、经理和电话,其中超市名称唯一确定超市关系的每一个元组。
每个超市只有一名经理。
5超市设有计划部、财务部、销售部等多个部门,每个部门只有一名部门经理,有多名员工,每个员工只属于一个部门。
部门信息包括:
超市名称、部门名称、部门经理和联系电话。
超市名称、部门名称唯一确定部门关系的每一个元组。
6员工信息包括:
员工号、姓名、超市名称、部门名称、职位、联系方式和工资。
其中,职位信息包括:
经理、部门经理、业务员等。
员工号唯一确定员工关系的每一个元组。
7商品信息包括:
商品号、商品名称、型号、单价和数量。
商品号唯一确定商品关系的每一个元组。
一名业务员可以负责超市内多种商品的配给,一种商品可以由多名业务员配给。
[概念模型设计]
根据需求分析阶段收集的信息,设计的实体联系图和关系模式(不完整)如下图:
实体联系图
[关系模式设计]
超市(超市名称、经理、地址、电话)
部门((a),部门经理、联系电话)
员工((b),姓名、联系方式、职位、工资)
商品(商品号、商品名称、型号、单价、数量)
配给((c),配给时间、配给数量、业务员)
4、根据问题描述,补充四个联系,完善图上图的实体联系图。
联系名可用联系1、联系2、联系3和联系4代替,联系的类型分为1:
1、1:
n和m:
n(或1:
1、1:
*和*:
*)。
5、根据实体联系图,将关系模式中的空(a)~(c)补充完整;
(2)给出部门和配给关系模式的主键和外键。
6、超市关系的地址可以进一步分为邮编、省、市、街道,那么该属性是属于简单属性还是复合属性?
请用100字以内文字说明。
(2)假设超市需要增设一个经理的职位,那么超市与经理之间的联系类型应修改为(d),超市关系应修改为(e)。
试题三
阅读以下说明和图,回答下列问题。
[说明]
某公司欲开发一个管理选民信息的软件系统。
系统的基本需求描述如下:
7每个人(Person)可以是一个合法选民(Eligible)或者无效的选民(Ineligible)。
8每个合法选民必须通过该系统对其投票所在区域(即选区,Riding)进行注册(Registration)。
每个合法选民仅能注册一个选区。
9选民所属选区由其居住地址(Address)决定。
假设每个人只有一个地址,地址可以是镇(Town)或者城市(City)。
10某些选区可能包含多个镇;而某些较大的城市也可能包含多个选区。
现采用面向对象方法对该系统进行分析与设计,得到如下图所示的初始类图。
类图
7、根据说明中的描述,给出上图中C1~C4所对应的类名(类名使用说明中给出的英文词汇)。
8、根据说明中的描述,给出上图中M1~M6处的多重度。
9、现对该系统提出了以下新需求:
(1)某些人拥有在多个选区投票的权利,因此需要注册多个选区;
(2)对手满足
(1)的选民,需要划定其“主要居住地”,以确定他们应该在哪个选区进行投票。
为了满足上述需求,需要对上图所示的类图进行哪些修改?
请用100字以内文字说明。
试题四
阅读下列说明和C代码,回答下列问题。
[说明]
计算一个整数数组a的最长递增子序列长度的方法描述如下:
假设数组a的长度为n,用数组b的元素b[i]记录以a[i](0≤i<n”)为结尾元素的最长递增子序列的长度为
;其中b[i]满足最优子结构,可递归定义为:
[C代码]
下面是算法的C语言实现。
10常量和变量说明
a:
长度为n的整数数组,待求其最长递增子序列
b:
长度为n的数组,b[i]记录以a[i](0≤i<n”)为结尾元素的最长递增子序列的长度,其中0≤i<n
len:
最长递增子序列的长度
i,j:
循环变量
temp:
临时变量
11C程序
#jnclude<stdio,h>
mtmaxL(int*b,mtn){
mtI,temp=0
for(i=0;i<n;i++){
(b[i]>temp)
temp=b[i]
returntemp;
intmain12{
intn,a[100],b[100],i,j,len;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
______:
for(i=1;i<n;i++) {
for(j=0,len=0;______;j++){
if( ______&&len<b[j])
Ien=b[j]
______;
}
Printf("len:
%d\n",maxL(b,n))
Primtf("\n")
}
10、 根据说明和C代码,填充C代码中的空______~______。
11、 根据说明和C代码,算法采用了______设计策略,时间复杂度为______(用O符号表示)
12、 已知数组a={3,10,5,15,6,8},据说明和C代码,给出数组b的元素值。
试题五
阅读下列说明和c++代码,将应填入横线处的字句写在答题纸的对应栏内。
[说明]
某灯具厂商欲生产一个灯具遥控器,该遥控器具有7个可编程的插槽,每个插槽都有开关按钮,对应着一个不同的灯。
利用该遥控器能够统一控制房间中该厂商所有品牌灯具的开关,现采用Command(命令)模式实现该遥控器的软件部分。
Command模式的类图如下图所示。
Command模式类图
[C++代码]
classLight{
public:
Light(stringname){/*代码省略*/}
voidon13{/*代码省略*/} //开灯
voidoff13{/*代码省略*/} //关灯
}:
classCommand{
public:
______;
}
classLightonCommand:
publicCommand{//开灯命令
private:
Light*light;
public:
LightonCommand(Light*light){this->light=light;}
Voidexecute13{______;}
};
classLightoffCommand:
publicCommand{//关灯命令
private:
Light*light;
public:
LightoffCommand(Light*light){this->light=light;}
Voidexecute13{______;}
};
classRemoteControl{//遥控器
private:
Command*onCommands[7];
Command*offCommands[7];
public:
RemoteControl13{/*代码省略/}
voidsetCommand(intslotCommand*onCommand,Command*offCommand){
______=onCommand;
______=offCommand;
}
voidonButtonWasPushed(intslot){______:
)
voidoffButtonWasPushed(intslot){______:
}
);
intmain13{
RemoteControl*remoteControl=newRemoteControl13;
Light*livingRoomLight=newLight("LivingRoom");
Light*kitchenLight=newLight("kitchen");
LightonCommand*IivingRoomLighton=newLightonCommand(livingRoomLight);
LightoffCommand*livingRoomLightoff=newLightoffCommand(livingRoomLight);
LightonCommand*kitchenLighton=newLightonCommand(kitchenLight);
LightoffCommand*kitchenLightoff=newLightoffCommand(kitchenLight);
remoteControl->setCommand(0,livingRoomLighton,livingRoomLightoff);
remoteControl->setCommand(1,kitchenLighton,kitchenLightoff);
remoteControl->onButtonWasPushed20;
remoteControl->offButtonWasPushed20;
remoteControl->onButtonWasPushed22;
remoteControl->offButtonWasPushed22;
/*其余代码省略*/
return0;
}
试题六
阅读下列说明和Java代码,将正确答案填入横线处。
[说明]
某灯具厂商欲生产一个灯具遥控器,该遥控器具有7个可编程的插槽,每个插槽都有开关按钮,对应着一个不同的灯。
利用该遥控器能够统一控制房间中该厂商所有品牌灯具的开关,现采用Command(命令)模式实现该遥控器的软件部分。
Command模式的类图如下图所示。
Command模式的类图
[java代码]
classLight{
publicLight20{};
publicLight(stringname){/*代码省略*/}
publicvoidon20{/*代码省略*/} //开灯
publicvoidoff20{/*代码省略*/} //关灯
}:
______{
publicvoidexecute20;
}
classLightonCommandimplementsCommand{//开灯命令
Lightlight;
publicLightonCommand(Lightlight){this.light=light;}
publicVoidexecute20{______;}
}
classLightoffCommandimplementsCommand{//关灯命令
Lightlight;
publicLightoffCommand(Lightlight){this,light=ight;}
publicVoidexecute20{______;}
}
classRemoteControl{//遥控器
Command[]onCommands[7];
Command[]offCommands[7];
PublicRemoteControl20{/*代码省略*/}
PublicvoidsetCommand(intslotCommandonCommand,CommandoffCommand){
______=onCommand;
______=offCommand;
}
PublicvoidonButtonWasPushed(intslot){______;}
PublicvoidoffButtonWasPushed(intslot){______;}
)
classremoteLoader{
publicstaticvoidmain(string[]args){
RemoteControlremoteControl=newRemoteControl20;
LightlivingRoomLight=newLight("LivingRoom");
LightkitchenLight=newLight("kitchen");
LightonCommandlivingRoomLighton=newLightonCommand(livingRoomLight);
LightoffCommandlivingRoomLightoff=newLightoffCommand(livingRoomLight);
LightonCommandkitchenLighton=newLightonCommand(kitchenLight);
LightoffCommandkitchenLightoff=newLightoffCommand(kitchenLight);
remoteControl.setCommand(0,livingRoomLighton,livingRoomLightoff);
remoteControl.setCommand(1,kitchenLighton,kitchenLightoff);
remoteControl.onButtonWasPushed28;
remoteControl.offButtonWasPushed28;
remoteControl.onButtonWasPushed30;
remoteControl.offButtonWasPushed30;
}
}
中级软件设计师2014年11月下午试题答案
试题一
1、E1:
客户;E2:
供应商
2、D1:
销售订单表;D2:
库存表;D3:
生产计划表;D4:
配方表;D5:
采购订单表
3、数据流名称:
支付细节;起点:
财务管理;终点:
E2
数据流名称:
销售订单:
起点:
销售订单表;终点:
5运送
数据流名称:
生产计划:
起点:
D3;终点:
3生产
数据流名称:
库存量;起点:
D2;终点:
4采购
数据流名称:
原材料数量:
起点:
4采购;终点:
D2
数据流名称:
未完成订单:
起点:
销售订单表;终点:
7存储。
试题二
4、
5、(a)超市名称、部门名称主键:
(超市名称、部门名称)外键:
超市名称、部门经理
(b)员工号、超市名称、部门名称
(c)商品号主键:
(商品号、业务员、配给时间)外键:
业务员、商品号
6、超市关系中的地址属于复合属性。
所谓复合属性就是指属性中含有多种信息,可以进一步拆分的属性,地址可以拆分成多个简单属性,符合这一特征。
(2)d是1:
n e超市名称、地址、电话
试题三
7、C1:
Address C2:
Riding C3:
Ineligible C4:
Eligi-ble
8、M1:
1,M2:
*,M3:
*,M4:
1,M5:
*,M6:
1
9、将Ml与M4由1,修改为1..*
试题四
10、b[0]=1
11、动态规划法O(n2)
12、B={1,2,2,3,3,4}
试题五
13、voldexecute(){}
14、light->on() 15、light->off()
16、onCommands[slot] 17、offCommands[slot]
18、onComnlands[slot]->execute() 19、offCommands[slot]->execute()
试题六
20、interfaceCommand21、light.on() 22、light.off()
23、onCommands[slot] 24、offCommands[slot]
25、onCommands[slot].execut() 26、offCommands[slot].execute()
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 中级 软件 设计师 下半年 下午 试题
![提示](https://static.bdocx.com/images/bang_tan.gif)