找考题网-背景图
未分类题

在窗体上画一个名称为Text1的文本框,一个名称为Command1的命令按钮,然后编写如下事件过程和通用过程: Private Sub Command1_Click() n=Val(Text1.Text) if n/2=n/2 Then f=f1(n) Else f=f2(n) End If Print f;n End Sub Public Function f1(ByRef x) x = x * x f1 =x + x End Function Public Function f2(ByVal x) x = x + x f2=x+x+x End Function 程序运行后,在文本框中输入6,然后单击命令按钮,窗体上显示的是
A.72 36
B.108 36
C.72 6
D.108 6

A.Text)
B.72
C.108
D.72
E.108

【参考答案】

A
解析:本题综合考查Function函数的建立,调用与传地址、传值的区别。由于输入的数字为6,6对2的浮点除法与整数除法的结果一致,都是3,所以执行Then后面的语句,即f=f1(n)。根据Function对f1的定义,参数x以传地址的方式传送数值,故n值在被传送到f1函数过程后,通过 x...

(↓↓↓ 点击‘点击查看答案’看完整答案 ↓↓↓)
热门试题

未分类题People in the United States in the nineteenth century were haunted by the prospect that unprecedented change in the nation's economy would bring social chaos. In the years following 1820, after several decades of relative stability, the economy entered a period of sustained and extremely rapid growth that continued to the end of the nineteenth century. Accompanying that growth was a structural change that featured increasing economic diversification and a gradual shift in the nation's labor force from agriculture to manufacturing and other nonagricultural pursuits.Although the birth rate continued to decline from its high level of the eighteenth and early nineteenth century, the population roughly doubled every generation during the rest of the nineteenth century. As the population grew, its makeup also changeD.Massive waves of immigration brought new ethnic groups into the country. Geographic and social mobility-- downward as well as upward--touched almost everyonE.Local studies indicate that nearly three-quitters of the population--in the North and South, in the emerging cities of the Northeast, and in the restless rural counties of the West--changed their residence of the Northeast, and in the restless rural counties of the West--changed their residence each decadE.As a consequence, historian David Donald has written, 'Social atomization affected every segment of society,' and it seemed to many people that 'all the recognized values of orderly civilization were gradually being erodeD.'Rapid industrialization and increased geographic mobility in the nineteenth century had special implications for women because these changes tended to magnify social distinctions. As the roles men and women played in society became more rigidly defined, so did the roles they played in the homE.In the context of extreme competitiveness and dizzying social change, the household lost many of its earlier functions and the home came to serve as a haven of tranquility and order. As the size of families decreased, the roles of husband and wife became more clearly differentiated than ever beforE.In the middle class especially, men participated in the productive economy while women ruled the home and served as the custodians of civility and culturE.The intimacy of marriage that was common in earlier periods was rent, and a gulf that at times seemed unbridgeable was created between husbands and wives.What does the passage mainly discuss?A.The economic development of the United States in the eighteenth century.B.Ways in which economic development led to social changes in the United States.C.Population growth in the western United States.D.The increasing availability of industrial jobs for women in the United States.

A.B.'
C.
What
D.The
E.
B.Ways
F.
C.Population
G.
D.The