问题 填空题

如图16-10所示.在列表框List1中已经有若干人的简单信息,运行时在Text1文本框(即“查找对象”右边的文本框)输入一个姓或姓名,单击“查找”按钮,则在列表框中进行查找,若找到,则把该人的信息显示在Text2文本框中。若有多个匹配的列表项,则只显示第1个匹配项;若未找到,则在Text2中显示“查无此人”。请填空。

Private Sub Conmlandl_Click() Dim k As Integer, n As Integer, found As Boolean found=False n=Len( 【6】 ) k=0 While k<List1. ListCount And Not foundIf Text1=Left $(List1. List(k), n)Then Text2= 【7】 found=TrueEnd Ifk=k+1 Wend If Not found Then Text2="查无此人" End If End Sub

答案

参考答案:[6]Text1. text或Text1 [7]List1. list(k)

解析:

[分析]: 变量n记录文本框Text1中的字符串长度,作为读取列表框List1中字符串使用,使得在比较文本框和列表框的字符串时具有相同的长度。一旦在列表框中找到与文本框相匹配的字符串,就将列表框中该段字符串赋给文本框Text2。变量found的作用是确认是否查找到有匹配的字符串,在初始时假定殴有匹配的字符串,当查找到有匹配的字符串时,将found赋值True。

填空题
阅读下面短文,根据所读内容,在文章后的空格里填入一个最恰当的单词,并将答案填写在答题卡的相应位置上。
注意:每个空格只填一个单词

Sue and Jim were neighbours for five years but they were never interested in each other. Then one day, Sue saw Jim’s music collection. She noticed a rare punk rock CD that she also owned. At that moment, she realized that they both had the same interest in music and they started talking. Sue said, “I thought we had nothing in common(相同)until I saw his CD by the New York Dolls.” They are now married and living with each other.
Some psychologists (心理学家) think that your taste in music is related to (有联系的) your personality. As part of a test at the University of Texas, Austin, USA, volunteers created a CD of their favourite songs. The volunteers then listened to each other’s CDs and made guesses about the CD creator’s personality—outgoing, adventurous, happy, and so on. These strangers correctly guessed much more about each others’ personalities through their CDs than through their clothes or taste in films. For example, Sue and Jim love punk music, which means they have outgoing personalities.
The psychologists who did the test found Snoop Dogg (hip-hop) fans are likely to be energetic and talkative. People who like U2 (rock/pop music) are generally independent and adventurous.
The psychologists also found that Louis Armstrong(jazz) fans tend to(倾向于) be serious and intelligent While fans of classical music are also likely to enjoy jazz music and tend to be shy.The psychologists were surprised to find that rap and heavy metal fans were also shier and quieter than many other music lovers.
Title: Music and      小题1:
An opinion
Your      小题2:   in music is related to your personality.
Findings
One’s clothes or taste in films is    小题3:  important than his/her CDs in a test of guessing about one’s personality.
It is   小题4:  that hip-hop fans are energetic and talkative.
People who 小题5:  rock or pop music are usually independent and adventurous.
Jazz fans tend to be  小题6:  and intelligent.
It’s  小题7:  that rap and heavy metal fans are shier and quieter than many other music lovers
An    小题8:
  小题9:   Sue and Jim were neighbours for five years, they were never interested in each other.
After Sue noticed they both had rare punk rock CDs, she found they had    小题10:  in common.
They are now married and living with each other.
 
单项选择题