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

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Dim k As Integer
Private Sub Form_Load()
k=15
End Sub
Private Sub Command1_Click()
Dim b As Integer
b=b+k
k=k+1
Print k,b
End Sub
程序运行时,两次单击命令按钮Command1后,在窗体上输出的第二行是( )。
A.17 31
B.15 31

A.17
B.15

【参考答案】

C
解析:本题定义了一个可在本窗体的所有过程中使用的窗体级变量k,并在Form_Load事件给它赋值15。第一次单击Command1时,定义了一个变量b,然后执行两条赋值语句,执行后变量b的值为15、变量k的值为16,输出的第一行为1615。第二次单击Command1按钮时,b重新定义,初值...

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

未分类题—Read the article about People Express.—Choose the best word to fill each blank, from A, B, C or D.—For each question 19-33 mark one letter (A, B, C or D )on your Answer Sheet.—There is an example at the beginning. People Express People Express, founded in April 1981, grew rapidly on the basis of low fares and no-frills service. It soon became a leading airline and (19)______ changed the industry as firms constantly engaged in price wars to lure passengers. Then, People Express' bubble (20)______ because it overexpanded, consumer complaints mounted and other airlines matched its fares on popular routes. In 1986, People Express (21)______ hundreds of millions of dollars and was forced to sell out to Texas Air, the owner of Continental and Eastern Airlines. In early 1987, Texas Air (22)______ People Express into its Continental division and industry observers believed (23)______ the costly fare wars would be ended. They could not have been more wrong. To stimulate business for its (24)______ Continental Airlines, Texas Air instituted a new low fare category (25)______ MaxSaver. The fare offered prices that were up to 40 per cent lower than 'supersaver' rates offered (26)______ all airlines. For example, the round-trip MaxSaver fare from New York to Houston was $79. The MaxSaver fares were immediately matched by all major airlines, (27)______ feared losing business. While MaxSaver rates were low, they also had restrictions. Tickets could not be (28)______ or flight times modified after purchase. Passengers would have to stay over either a Saturday or Sunday, Reservations had to be made at least two days (29)______ and there were limited seats available. Three weeks after MaxSaver rates were (30)______ American Airlines announced plans to raise its discount fares and require 30-day (31)______ purchasing for its lowest fares. It felt it could not continue at the rates in effect. However, just 10 days (32)______ American Airlines had to revise its plan. Texas Air refused to abandon the MaxSaver fare; it even extended the program into the busy summer sea son. Competitors went along and the price war raged on, (33)______ an executive's comment that 'nobody's cost structure can survive MaxSavers.'A.littleB.slowlyC.quickD.radically