问题 问答题

注意:下面出现的“”均为c:\wexam\25160001。
请根据以下各小题的要求设计Visual Basic应用程序(包括界面和代码)。
(1) 在Form1的窗体上建立一个主菜单,标题为“操作”,名称为Op,该菜单有两个子菜单,其标题分别为“显示”和“清除”,其名称分别为Dis和Clea。编写适当的事件过程,程序运行后,如果单击“操作”菜单中的“显示”命令,则在窗体上显示“等级考试”;如果单击“清除”命令,则清除窗体上显示的内容。程序的运行情况如图14-1所示。
注意:存盘时必须存放在考生文件夹下,工程文件名为sjt1.vbp,窗体文件名为sjt1.frm。
(2) 在Form1的窗体上画一个标签,其名称为Lab1;再画一个列表框,其名称为L1,通过属性窗口向列表框中添加若干个项目,每个项目的具体内容不限,编写适当的事件过程。程序运行后,如果双击列表框中的任意一项,则把列表中的项目数在标签中显示出来。程序中不准使用任何变量,运行情况如图14-2所示。
注意:存盘时必须存放在考生文件夹下,工程文件名为sjt2.vbp,窗体文件名为sjt2.frm。

答案

参考答案: 在窗体上建立好控件后,先设置控件属性,再编写事件过程。
Visual Basic中,菜单被看作控件,具有属性和事件。菜单由“菜单编辑器”来创建。在窗体上打印信息通过Print方法方法来实现。清除在窗体上的打印的信息要通过Cls方法来实现
Cls方法清除运行时Form或PictureBox所生成的图形和文本:
语法:Object.Cls
object代表一个对象表达式。如果省略object,则默认为当前的Form窗体。解题步骤:
第一步:打开“菜单编辑器”,建立菜单并设置菜单属性。菜单的属性设置见表14-1。
表 14-1

控 件
填空题

Less education, income linked to obesity in women, not men


Women who are better educated and live in households that are middle-income or above are less likely to be obese than women who are less educated and live in the lowest income households, new government research shows.
Among men, there is not a statistically significant (26) in obesity based on income and very (27) difference based on education, the data show.
(28) , about one in three U.S. adults-almost 73 million people-are obese, which is (29) 30 or more pounds over a (30) weight. Extra weight raises the (31) of diabetes, heart disease, some types of cancer and other (32) .
"There is a relationship between obesity and income, but it’s not a (33) story," says Cynthia Ogden, an epidemiologist with the National Center for Health Statistics, part of the Centers for Disease Control and Prevention.
"When looking at these two (34) of socioeconomic status-income and education-their (35) is greater on women than men," she says.
Jennifer Lovejoy, president of the Obesity Society, says that (36) -income women may be more likely to become obese because of environmental (37) such as lack of access to safe places to do physical activity and easy access to fast food.
Among the findings:
·29% of women who live in households with an annual income of $77,000 or more for a family of four are obese in opposition (38) 42% of women who live in households with an annual income below $29,000 for a family of four.
·23% of women with a college degree are obese, significantly less than the 42% of women with (39) than a high school education.
·33% of men who live in households with an annual income of $77,000 or more for a family of four are obese, (40) 29% of men who live in households with an annual income below $29,000 for a family of four are obese. This difference is not considered statistically (41) .
The analysis is based on (42) from the National Health and Nutrition Examination Survey, which is considered the gold (43) for evaluating obesity because it is a(an) (44) survey of people whose weight and height are actually (45) rather than being self-reported.

A. collected B. estimated C. measured D. added