下列程序段中,如果变量a中保存的字符是逗号“,”,则以下程序段执行后,变量str的值是 Select Case a Case"A"To"Z" str="Upper Case" Case"0"To"9" str="Number" Case"!","?",",

admin2018-10-20  46

问题 下列程序段中,如果变量a中保存的字符是逗号“,”,则以下程序段执行后,变量str的值是
Select Case a
Case"A"To"Z"
str="Upper Case"
Case"0"To"9"
str="Number"
Case"!","?",",",")",";"
str="Punctuaton"
Case""
str="NullString"
Case Is<32
str="Special Character"
Case Else
str= UnknownCharacter"
End Select

选项 A、UnknownCharacter
B、SpecialCharacter
C、UpperCase
D、Punctuaton

答案D

解析 本题考查的是多路分支语句Select caser~End Case知识点。该题将字符“,”赋值给变量a。程序会执行满足case后条件的那一条指令,然后结束程序。本题变量a的值与Case"!","?",",",")",";"相匹配,所以执行该语句块中的语句“str="Punctuaton"”。因此应选择选项D。
转载请注明原文地址:https://kaotiyun.com/show/guMp777K
0

最新回复(0)