问题 问答题


阅读下列说明和图,回答问题1至问题3。
【说明】
某大型旅店为了便于管理,欲开发一个客房管理系统。希望实现客房预订、入住登记、账务结算、退房,以及将服务项目记入客人账单。
旅客包括散客和团体,散客预订或入住时需要提供姓名、性别、身份证和联系电话,团体则提供团体名称、负责人的姓名、性别、身份证和联系电话,以及团体人数。对于散客,还要提供换房。
旅店还提供了很多服务项目,比如早餐。对每一个入住客人,服务列表记录了住宿期间的各项服务,包括服务类型、日期、数量等。当然,客人也可以不要任何服务。
旅店的客房有一个唯一的房间号,分为不同的类别,不同的房间床位数和价格不同。
为了有效的管理,需要记录每天的客房状态。客房的状态有:空闲、占用、已预订和维修。
· 客人入住后,客房处于占用状态。
· 客人退房后,客房处于空闲状态。
· 客人预订后,客房处于已预订状态。
· 预订客人入住后,客房处于占用状态。
· 预订客人取消预订后客房处于空闲状态。
· 需要维修时客房处于维修状态。
· 维修完成后客房处于空闲状态。
该系统采用面向对象方法开发,系统中的类及类之间的关系用UML类图表示,如图9-12所示是该系统的类图的一部分,图9-13描述了客房状态的转变情况。


【问题2】
在UML中,重复度(Multiplicity)定义了某个类的一个实例可以与另一个类的多少个实例相关联。通常把它写成一个表示取值范围的表达式或者一个具体的值。例如图9-12中的类客人和住宿,客人端的“1”表示:一个住宿类的实例只能与一个客人类的实例相关联;住宿类端的“0..*”表示:一个住宿类的实例可以与0个或多个客人类的实例相关。请指出图9-12中(1)到(4)处的重复度分别为多少

答案

参考答案:

解析:0..1 (2) 1..* (3) 1 (4) 0..*

[分析]: 散客入住时只改变一个客房状态,而团体入住时则有可能改变多个客房状态;客房状态改变不一定是住宿导致的,客房维修同样改变客房状态。因此(1)处应填0..1,(2)处应填1..*。 客人可以有多项服务,但只需用一张“服务列表”,当然也可能不需要任何服务;而一张服务列表必然属于而且只输于一个住宿。因此(3)处应填1,(4)处应填0..1。

单项选择题
单项选择题

Electronic mail has become an extremely important and popular means of communication.
The convenience and efficiency of electronic mail are threatened by the extremely rapid growth in the volume of unsolicited commercial electronic mail. Unsolicited commercial electronic mail is currently estimated to account for over half of all electronic mail traffic, up from an estimated 7 percent in 2001, and the volume continues to rise. Most of these messages are fraudulent or deceptive in one or more respects.
The receipt of unsolicited commercial electronic mail may result in costs to recipients who cannot refuse to accept such mail and who incur costs for the storage of such mail, or for the time spent accessing, reviewing, and discarding such mail, or for both. The receipt of a large number of unwanted messages also decreases the convenience of electronic mail and creates a risk that wanted electronic mail messages, both commercial and noncommercial, will be lost, overlooked, or discarded amidst the larger volume of unwanted messages, thus reducing the reliability and usefulness of electronic mail to the recipient. Some commercial electronic mail contains material that many recipients may consider vulgar or pornographic in nature.
The growth in unsolicited commercial electronic mail imposes significant monetary costs on providers of Internet access services, businesses, and educational and nonprofit institutions that carry and receive such mail, as there is a finite volume of mail that such providers, businesses, and institutions can handle without further investment in infrastructure. Many senders of unsolicited commercial electronic mail purposefully disguise the source of such mail.
Many senders of unsolicited commercial electronic mail purposefully include misleading information in the messages’ subject lines in order to induce the recipients to view the messages. While some senders of commercial electronic mail messages provide simple and reliable ways for recipients to reject (or ’opt-out’ of) receipt of commercial electronic mail from such senders in the future, other senders provide no such ’opt-out’ mechanism, or refuse to honor the requests of recipients not to receive electronic mail from such senders in the future, or both.
Many senders of bulk unsolicited commercial electronic mail use computer programs to gather large numbers of electronic mail addresses on an automated basis from Internet websites or online services where users must post their addresses in order to make full use of the website or service.
The problems associated with the rapid growth and abuse of unsolicited commercial electronic mail cannot be solved by the government alone. The development and adoption of technological approaches and the pursuit of cooperative efforts with other countries will be necessary as well.

Which of the following is NOT true about unwanted e-mail

A.It costs money to receive them.

B.It’s free to store them.

C.It takes time to access them.

D.It takes time to throw them away.