问题 问答题


阅读以下某前台销售子系统的技术说明和UML图,根据要求回答问题1~问题4。
[说明]
某超市管理系统的前台销售子系统以最基本的方式处理销售业务。系统的功能需求如下:
①记录每种商品的编号、单价和现有数量;
②为顾客选购的商品计价、收费,并打印清单;
③帮助商家找出哪种商品将脱销,从而及时补充货源;
④随时按上级系统的要求报告当前的款货数量、增减商品的种类或修改商品定价;
⑤交接班时结算货款数目和商品数目。
每台收款机可以处理任何数目的销售事件,但一个销售事件只能由一台收款机处理。每个销售事件从收款机响应收款人员的指令开始,先向商品发送检索请求消息来查找将被出售的商品。如果该商品的数量少于下限,则向供货员发送缺货登记消息。每名供货员可以提供一种或多种商品,同一品牌的商品只能由一位供货员来提供。接着收款机发送计价和入账消息请求售出操作,再由销售事件发送记账消息给相应的账册,并控制流程返回收款机等待下一次销售操作。每本销售账册可以记录任何数目的销售事件,但一个销售事件只能由一本销售账册记录。
该销售子系统采用面向对象方法开发,系统中的类及类之间的关系用UML类图表示,图1-11是该系统类图中的一部分;系统的动态行为采用UML序列图表示,图1-12是销售事件部分的序列图。

[问题2]
请将图1-11中类商品、类特价商品和类计量商品3者之间的联系补充完整。

答案

参考答案:

解析:[问题2] 在UML类图中,“

”表示其相连的两个类之间存在泛化 (generalization)关系。这种关系描述了一般事物与该事物中特殊种类之间的关系,子用例是父用例的一种特殊形式,子用例继承了父用例所有的结构、行为和关系,还可以增加或者覆盖父用例的行为。子用例可以出现在父用例出现的任何位置。 在图1-11类图中,类特价商品和类计量商品是类商品的子类,它们将继承类商品的所有属性和操作,并且又有自己特殊的属性和操作。因此这3者之间的联系是泛化关系,如图1-20所示。

阅读理解

.

Dear Abby,

This is my first letter to you, although I have been reading your column for many years. I need an outside opinion.

I am a grandmother in my 70s and have just returned from visiting my daughter, her husband and their three dearly loved children--all under the age of 5--and I'm upset with some of their parenting ways.

For example: They lock the doors to their children's bedrooms at night because the children might get out of their beds and wander around the house, and we may not hear them."

If one child should get punishment, all three are punished, and if one child says a naughty

word, all three are given hot sauce (辣酱汁) in the mouth. I know these parents love their children very much, but are these ways of disciplining them wise? Please understand, it is not my aim to interfere (干涉).

--- Gram

Dear Gram,

Children's bedroom doors should not be locked. Should a flash fire break out, it would be a nightmare (噩梦).Punishing all the children when only one has earned the punishment is a good way to make them grow up to hate each other. Children who use "naughty" words should not be punished with hot sauce in the mouth-they should be taught the proper and acceptable word to use instead of the "naughty" word. 

---  Abby

49. Gram's daughter _____________.

A. is very strict with her children            B. does not love her three children

C. always punishes her children at night      D. often gives her children hot sauce

50. The passage doesn't say so, but from the lines you'll find that __________.

A. Gram likes writing letters               B. Gram likes watching children

C. Gram likes reading newspapers          D. Gram likes visiting her daughter

51. Gram writes the letter in order to ____________.

A. disclose her daughter's ways as a mother        

B. criticize her daughter's ways as a mother

C. express her anger about her daughter s ways as a mom

D. get others' opinion about her daughter's ways as a mom

52. Which of the following is NOT true according to the passage?

A. Gram seems to care for her grand children very much.

B. Gram is against some of her daughter's ways as a mom.

C. Abby is for only one of Gram's daughter's ways as a mom.

D. Abby agrees with Gram about her daughter's ways as a mom.

单项选择题