问题 单项选择题

在窗体上画一个命令按钮和一个文本框,名称分别为Command1和Text1,然后编写如下程序:
Private Sub Command1_Click()
a=InputBox("请输入日期(1~31)")
t="旅游景点:"&IIf(a>0 And a<=10,"长城","")&_
IIf(a>10 And a<=20,"故宫"," ")&IIf(a>20 And a<=31,"颐和园"," ")
Text1.Text=t
End Sub
程序运行后,如果从键盘上输入16,则在文本框中显示的内容是______。

A) 旅游景点:长城故宫
B) 旅游景点:长城颐和园
C) 旅游景点:颐和园
D) 旅游景点:故宫

答案

参考答案:D

解析: 在该题中,关键是知识点IIf(),IIf()函数的形式是:Ilf(表达式,当条件为True时的值,当条件为False时的值)。因为16大于10且小于20,所以只有在第2个IIf()中表达式的值为True,取"故宫",而其他两个IIf()中表达式的值均为False,所以第1个和第3个中取的均为" "。故t最后的值为"旅游景点:故宫"。

完形填空
完形填空:阅读下面短文,掌握其大意,然后从A、B、C、D四个选项中选出最佳选项。
       It was a Monday morning. As he walked into the   1   ,  the teacher heard a low voice, "Here is the
teacher. I'm   2   this boring fellow is going to talk about putting in commas." It was   3   voice. His name
is Bill. He was talking   4   the boy next to him. 
       The teacher didn't get angry. He said   5   about it but he really began to talk about putting in commas,
and then he wrote   6   the sentence: "Bill says the teacher is a boring fellow." 
       The class   7   and Bill's face   8   red.
       "Now," said the teacher, "I will   9   you how important commas are."
       He put two commas in the sentence, and now read, "  10   is a boring fellow."
( )1. A. library                
( )2. A. sorry                  
( )3. A. his                    
( )4. A. with                    
( )5. A. much                    
( )6. A. on his desk            
( )7. A. laughed                
( )8. A. began                  
( )9. A. answer                  
( )10. A. The teacher
says, Bill
B. school                
B. sure                  
B. the teacher's        
B. of                    
B. everything            
B. on the blackboard      
B. stopped                
B. changed                
B. show                  
B. Bill, says, the teacher
C. classroom              
C. glad                  
C. a boy's              
C. about                  
C. something              
C. in his book            
C. looked                
C. turned                
C. ask                    
C. The teacher,
says, Bill
D. office                  
D. surprised                
D. a girl's              
D. at                      
D. nothing                  
D. in Bill's exercise-book
D. read                    
D. grew                    
D. give                    
D. Bill, says the          
teacher                    
单项选择题