问题 问答题

[说明]


某公司拟开发一个多用户电子邮件客户端系统,部分功能的初步需求分析结果如下。
(1) 邮件客户端系统支持多个用户,用户信息主要包括用户名和用户密码,且系统中的用户名不可重复。
(2) 邮件账号信息包括邮件地址及其相应的密码,一个用户可以拥有多个邮件地址(如userl@123.com)。
(3) 一个用户可以拥有一个地址簿,地址簿信息包括联系人编号、姓名、电话、单位地址、邮件地址1、邮件地址2和邮件地址3等信息。地址簿中一个联系人只能属于一个用户,且联系人编号唯一标识一个联系人。
(4) 一个邮件账号可以含有多封邮件,一封邮件可以含有多个附件。邮件主要包括邮件号、发件人地址、收件人地址、邮件状态、邮件主题、邮件内容、发送时间和接收时间。其中,邮件号在整个系统内唯一标识一封邮件,邮件状态有已接收、待发送、已发送和已删除4种,分别表示邮件是属于收件箱、发件箱、已发送箱和废件箱。一封邮件可以发送给多个用户。附件信息主要包括附件号、附件文件名和附件大小。一个附件只属于一封邮件,附件号仅在一封邮件内唯一。
1. 根据以上说明设计的E-R图如图8-7所示,请指出地址簿与用户、电子邮件账号与邮件,以及邮件与附件之间的联系类型。

答案

参考答案:(1)1
(2) 1
(3) m 或 n 或 *
(4) 1
(5) n 或 m 或*

解析:
由题干中的关键信息“(3)一个用户可拥有一个地址簿,地址簿信息包括联系人编号……地址簿中一个联系人只能属于一个用户,且联系人编号唯一标识一个联系人……”和常识可知,“地址簿”实体与“用户”实体之间存在联系“拥有1”,其联系的类型是一对一 (1:1),即(1)空缺处应填入1。
由题干中的关键信息“(4)一个邮件账号可以含有多封邮件……邮件主要包括邮件号……邮件号在整个系统内唯一标识一封邮件……”和常识可知,“邮件账号”实体与“邮件”实体之间存在联系“包含”,其联系的类型是一对多(1:n)。因此(2)空缺处应填入1,(3)空缺处应填入n。
由题干中的关键信息“(4)……一封邮件可以含有多个附件……一个附件只属于一封邮件……”可知,“邮件”实体与“附件”实体之间存在联系“属于”,其联系的类型是一对多(1:n)。因此(4)空缺处应填入1,(5)空缺处应填入n。
整理以上分析结果,可得该多用户电子邮件客户端系统完整的实体联系图,如图8-9所示。
[*]

单项选择题
单项选择题

Earlier this summer Arnold Schwarzenegger, California’s governor, said that the state’s penal system was "falling apart in front of our very eyes". Indeed so. Some 172,000 inmates are crowded into institutions—from the state’s 33 prisons to its 12 "community correctional facilities"—that are meant to house fewer than 90,000. Drug abuse is rampant; so too are diseases such as HIV and hepatitis C. Race-based gangs pose the constant threat of violence, riot and even murder. And with more than 16,000 prisoners sleeping in prison gymnasiums and classrooms, rehabilitation programs are virtually non-existent—which helps to explain why two-thirds of California’s convicts, the highest rate in the country, are back in prison within three years of being released.

Will the governor’s summons of a special session of the state legislature, beginning this week, bring a remedy The reason for the session is to discuss Mr. Schwarzenegger’s request for almost $ 5.8 billion of public money to be pumped into the prison system. Bonds for $ 2 billion would finance ten 500-bed "re-entry facilities" for prisoners nearing the end of their sentences; another $ 2 billion would expand existing prisons; $1.2 billion would be earmarked for two new prisons; and $ 500m would go for new prison hospitals.

Money alone will provide neither an immediate solution nor a lasting one. The first problem is that California simply puts too many offenders in prison. The imprisonment rate, which has risen almost eight-fold since 1970 and is way ahead of any European country, has consistently meant overcrowding despite the construction of 22 new prisons in the past 20 years.

The 1994 "three-strikes" law, approved by voters in a referendum, means handing out 25-years-to-life sentences for often trivial third offences—and results in the growing presence in prison of elderly inmates who cost the taxpayer far more than the average of $ 34,000 a prisoner. Meanwhile, the practice of returning parole violators to prison, even for relatively trivial mis-steps such as missing a drugs test, also strains the system; some 11% of inmates are parole violators. Added to all these are more than 5,000 illegal immigrants being held on behalf of the federal government.

The second problem is that any attempt to reform California’s penal policy becomes hostage to politics. Two years ago, the governor was expressing optimism. He added the word "rehabilitation" to California’s department of corrections, appointed Rod Hickman, a reform- minded former prison guard, to oversee the system and promised to lessen the power of the 31,000-p prison guards’ union, not least by breaking the "code of silence" that protects corrupt or violent guards. But that was then. The reality now is that Mr. Hickman resigned in March. Evidence indicates that the governor’s office may have given the code of silence in California’s prisons a new lease on life.

Many experts say that with no moderation in sentencing policies on the horizon, the prison population is expected to grow by another 21,000 over the next five years—enough to out-pace any prison-building program. Thus, the dream of prison reforms will never touch the ground.

Which of the following is true about the "three-strikes" law()

A.It actually wastes more resources in terms of finance

B.It is approved by voters to save money for the taxpayers

C.It severely punishes those who violate the law for the third time

D.It increases the cost of keeping a prisoner to $ 34,000