问题 单项选择题

单击一次命令按钮后,下列程序的执行结果是( )。  Private Sub Command1_Click()   s=P(1) +P(2) +P(3) +P(4)   Print s  End Sub  Public Function P(N As Integer)   Static Sum   For i=1 To N   Sum=Sum+i   Next i   P=Sum  End Function

A.15

B.25

C.35

D.45

答案

参考答案:C

解析:在被调用过程中,有这样的语句“Static Sum”,因为变量Sum是局部变量,局部变量除了可以用Dim语句声明外,还可用Static语句将变量声明为静态变量,它在程序运行过程中可保留变量的值,这就是说每次调用过程时,用Static说明的变 量保持原来的值。具体过程分析如下: 调用P(1),所以在被调过程中N=1,执行For Next循环,P(1)=Sum=1; 调用P(2),所以在被调过程中N=2,执行For Next循环,P(2)=Sum=4; 调用P(3),所以在被调过程中N=3,执行For Next循环,P(3)=Sum=10; 调用P(4),所以在被调过程中N=4,执行For Next循环,P(4)=Sum=20; 不难看出,最后输出的结果S值应为1+4+10+20=35,所以选项C)正确。

阅读理解

Although credit cards are becoming a more acceptable part of the financial scene, they are still regarded with doubts by many as being a major part of the “live now pay later” syndrome(综合症).Along with hire-purchase, rental and leasing schemes(租赁项目), they provide encouragement to spend more money.Of course, it is only the hotheaded who give way to the temptation to live, temporarily at least, beyond their means, and such people would no doubt manage to do so even without credit cards.

Advertising campaigns have, however, promoted a growing realization of the advantages of these small pieces of plastic. They prevent need to carry large amounts of cash and are always useful in emergencies.

All the credit card organizations charge interest on a monthly basis which may work out as high as 25 per cent a year, yet sensible purchasing using a card can mean that you obtain up to seven weeks, interest-free credit.Using the card abroad, where items frequently take a long time to be included on your account, can extend this period even further.

It is worthwhile shopping around before deciding on a particular credit card. It is necessary to consider the amount of credit granted; interest rates, which may vary slightly; the number and range of outlets(经销店), though most cards cover major garages, hotels, restaurants and department stores; and of course, what happens if your card is lost or stolen.A credit card thief may be sitting on a potential goldmine particularly if there is a delay in reporting the loss of the card.

However, if used wisely, a credit card can cost nothing, or at least help to tide you over a period of financial difficulty.

小题1:The hotheaded are people who ________.

A.spend more money than they have

B.spend less money than other people

C.save money

D.make money小题2:The disadvantage of credit cards is ________.

A.to enable you to buy things without carrying large amount of cash

B.to encourage people to spend more money

C.to be always useful in emergencies

D.to help people tide over a period of financial difficulty小题3:Deciding on a particular credit, you do not have to consider ________.

A.the amount of credit granted  

B.the number and range of outlets

C.the possibility of loss of money

D.the department stores where you are going to use your credit cards小题4:The underlined words in the last paragraph probably means ________.

A.floating with the tide of

B.going through a difficult period of

C.rising and falling with the tide of

D.attempting to go against the tide of

单项选择题