试题与答案

设a=6,则执行 x=IIf(a>5,-1,0) 后,x的值为______。A.

题型:单项选择题

题目:

设a=6,则执行
x=IIf(a>5,-1,0)
后,x的值为______。

A.6

B.5

C.0

D.-1

答案:

参考答案:D

解析:[知识点] 模块NBA程序设计基础
[评析] IIf函数的调用格式为:IIf(条件式,表达式1,表达式2)该函数是根据“条件式”的值来决定函数返回值。“条件式”值为“真(Ture)”,函数返回“表达式1”的值;“条件式”值为“假(False)”,函数返回“表达式2”的值。在本题中a>5为True,所以返回的是-1。

试题推荐
题型:补全对话,情景问答

补全对话。

A: Do you want to go to a movie, Edward?

B: Yes, that 1_____ good.

A: What kind of movies do you like?

B: Well, I like comedies because they're funny. And I 2_____  thrillers are great.

A: How about documentaries?

B: No. Documentaries are 3_____. How about you?

A: I don't like documentaries, either. 4_____  I don't like thrillers-they're scary.

B: So what 5_____  of movies do you like?

A: Well, I like action movies.

B: You do?

A: Uh-huh. They're exciting. And I like Beijing Opera, too. It's very interesting.

     My father and I like it a lot.

查看答案
微信公众账号搜索答案