问题 多项选择题

在考生文件夹中有工程文件sjt5.vbp及其窗体文件sjt5.frm,该程序是不完整的,请在有号的地方填入正确内容,然后删除及所有注释符(即’号)但不能修改其他部分。存盘时不得改变文件名和文件夹。
本题描述如下:
在名称为Form1的窗体上有一个文本框,名称为Text1,MultiLine属性为True,Scroll Bars属性为2;两个命令按钮名称分别为Cmd1和Cmd2,标题分别为“读入数据”和“计算保存”,如图3—1所示。要求程序运行后,如果单击“读入数据”按钮,则读入“in.txt”文件中的 100个整数,放入一个数组中(数组下界为1),同时在文本框中显示出来;如果单击“计算保存”按钮,则计算其中前50个数之和,并把求和结果在文本框Text1中显示出来,同时把结果存入考生文件夹中的文件“out.txt”中。(在考生的文件夹下有标准模块mode.bas,其中的putdata过程可以把结果存入指定的文件)。


注意:文件必须存放在考生文件夹下,窗体文件名为sjt5.frm,工程文件名为sjt5.vbp,计算结果存入out.txt文件,否则没有成绩。

答案

参考答案:① 在窗体上建立好控件后,先设置控件属性,再编写事件过程。
② 文本框显示的内容由Text属性设置,Muhiline属性决定文本框是否可多行显示;按钮的标题由Caption属性设置,单击命令按钮触发Click事件。题中涉及到文件的操作,读入顺序文件以顺序的方式打开,用input #语句读取数据。另外需要注意的是对文件操作完后,一定要关闭文件。
③ 解题步骤;
第一步:建立界面并设置控件属性。程序中用到的控件及其属性值见表D。
表 D

控 件
问答题

The produce departments of the future may look like nothing on earth, and with good reason. Chinese scientists have been growing tomatoes the size of softballs, cucumbers as long as baseball bats and other outsize fruits and vegetables, using seeds that have been shot into space. The seeds are then exposed to seven types of extraterrestrial conditions, from zero gravity and cosmic radiation to subatomic particles. (46) As these space veggies grow back on earth, they are selected for desirable traits--bulk, appearance or certain nutrients--then bred through successive generations to ensure that the mutations are consistent.

Chinese scientists don’t understand exactly how a trip into space alters the seeds’ DNA and yields such effects, but it’s not just size that changes. (47) Tong Yichao, whose firm, the Beijing Flying Eagle Green Foods Group, has been sending seeds and seedlings aboard Chinese spacecraft since 1999, says it has grown space tomatoes with 27 percent more of the antioxidant beta carotene than ordinary ones, and six-foot-tall cotton plants that produce longer, more flexible threads. Using conventional methods, "a scientist might create just three new plants in his lifetime," says Tong. "We’ve developed more than 50 since 1999."

(48) A dozen or so Chinese firms are paying up to $ 45 000 a gram to place various flora aboard satellites and manned spacecraft. The long-term goal: to feed more people and help endangered species escape extinction. To date, nearly 3 000 botanical species-including garden vegetables, medicinal herbs and flowers--have been sent into orbit and brought back to earth.

(49) The commercial promise of China’s space veggies has yet to, er, bear fruit. It’ s legal to sell the cosmic produce, and commercial farms have purchased some space plants. But most are being developed in labs or experimental greenhouses because no one wants to go to market before the safety and quality of the produce have been established. Even so, the idea of space flora is proving irresistible to a novelty-loving Chinese public. (50) When Tong displayed a handful of monster space eggplants--the largest of which weighed more than four pounds--at an expo, one disappeared before the show opened. Hot stuff, for sure.

(46) As these space veggies grow back on earth, they are selected for desirable traits--bulk, appearance or certain nutrients--then bred through successive generations to ensure that the mutations are consistent.