问题 单项选择题

下列程序段执行以后,内存变量A和B的值是 ______。 CLEAR A=10 B=20 SET UDFPARMS TO REFERENCE DO SQ WITH(A) ,B &&参数A是值传送,B是引用传送 A,B PROCEDURE SQ PARAMETERS X1,Y1X1=X1*X1Y1=2*X1 ENDPROC

A.10 200

B.100 200

C.100 20

D.10 20

答案

参考答案:A

解析:[知识点] 参数的传递[评析] 过程定义时,如果形式参数被说明为传值,则过程调用只是相应位置实参的值“单向”传送给形参处理,而被调用过程内部对形参的任何操作引起的形参值的变化均不会反馈、影响实参的值。由于这个过程,数据的传递只是单向性,故称为“传值调用”的“单向”作用形式。反之,如果形式参数被说明为传址,则过程调用是将相应位置实参的地址传送给形参处理,而被调用过程内部对形参的任何操作引起的形参值的变化又会反向影响实参的值。在这个过程中,数据的传递具有双向性,故称为“传址调用”的“双向”作用形式。此题中参数A为值传送,即A值为10;参数B为引用传送,根据X1=X1*X1;Y1=2*X1得Y1值为200即B的值。

阅读理解

阅读理解。

     Andrew Ritchie, inventor of the Brompton folding bicycle, once said that the perfect portable bike would

be "like a magic carpet…You could fold it up and put it into your pocket or handbag". Then he paused:"But

you'll always be limited by the size of the wheels. And so far no one has invented a folding wheel."

     It was a rare-indeed unique-occasion when I was able to put Ritchie right. A 19th-century inventor,

William Henry James Grout, did in fact design a folding wheel. His bike, predictably named the Grout Portable,

had a frame that split into two and a larger wheel that could be separated into four pieces. All the bits fitted

into Grout's Wonderful Bag, a leather case.

     Grout's aim: to solve the problems of carrying a bike on a train. Now doesn't that sound familiar? Grout

intended to find a way of making a bike small enough for train travel: his bike was a huge beast. And importantly,

the design of early bicycles gave him an advantage: in Grout's day, tyres were solid, which made the business

of splitting a wheel into four separate parts relatively simple. You couldn't do the same with a wheel fitted with

a one-piece inflated (充气的) tyre.

     So, in a 21st-century context, is the idea of the folding wheel dead? It is not. A British design engineer,

Duncan Fitzsimons, has developed a wheel that can be squashed into something like a slender ellipse (椭圆).

Throughout, the tyre remains inflated.

     Will the young Fitzsimons's folding wheel make it into production? I haven't the foggiest idea. But his

inventiveness shows two things. First, people have been saying for more than a century that bike design has

reached its limit, except for gradual advances. It's as silly a concept now as it was 100 years ago: there's plenty

still to go for. Second, it is in the field of folding bikes that we are seeing the most interesting inventions. You

can buy a folding bike for less than £1,000 that can be knocked down so small that it can be carried on a

plane-minus wheels, of course-as hand baggage.

     Folding wheels would make all manner of things possible. Have we yet got the magic carpet of Andrew

Ritchie's imagination? No. But it's progress.

1. We can infer from Paragraph 1 that the Brompton folding bike _____.

A. was portable

B. had a folding wheel

C. could be put in a pocket

D. looked like a magic carpet

2. We can learn from the text that the wheels of the Grout Portable _____.

A. were difficult to separate

B. could be split into 6 pieces

C. were fitted with solid tyres

D. were hard to carry on a train

3. We can learn from the text that Fitzsimons's invention _____.

A. kept the tyre as a whole piece

B. was made into production soon

C. left little room for improvement

D. changed our views on bag design

4. Which of the following would be the best title for the text?

A. Three folding bike inventors

B. The making of a folding bike

C. Progress in folding bike design

D. Ways of separating a bike wheel

多项选择题