问题 多项选择题

注意:下面出现的“考生文件夹”均为c:\wexam\25160001。
在考生文件夹下有工程文件sjt5.vbp及窗体文件sjt5.frm,该程序是不完整的,请在有号的地方填入正确的程序代码,然后删除及所有注释符号(即’号),但不能修改其他部分。修改后的程序文件都保存,存盘时不得修改文件夹和文件名。
本题描述如下:
在窗体上有一个名称为Text1的文本框,三个命令按钮,名称分别是C1、C2和C3,标题分别是“读入”、“加密”和“存盘”。要求程序运行后,点击“读入”按钮,将文本文件in7.txt(该文件在考生文件夹下)中的文本信息读入文本框Text1中;点击“加密”按钮将Text1中的英文字母加密转换,并将转换后的结果显示到Text1中。转换方式为转换成该字母对应字母表中后两个位置的字母。例如,转换前的字母是“a”,则转换后的是“c”;点击“存盘”按钮,则将转换后的文本框中的文本保存到out7.txt文件中(该文件保存到考生文件夹下)。程序设计界面如图12-8所示。

答案

参考答案: 文本框中显示的内容由Text属性设置。单击命令按钮触发Click事件,命令按钮的标题由Caption属性设置。
题目要求加密原理是:在原来字符的ASCII码加上一个整数(题目要求为B)转换为其他的字符,然后再将加密后的字符显示在文本框中。这样就用到了Chr函数和Asc函数。
Chr函数返回String,其中包含有与指定的字符代码相关的字符。其语法格式为:
Chr(charcode)
charcode必要参数,是一个用来识别某字符的Long。
Asc函数返回一个Integer,代表字符串中首字母的字符代码。其语法格式为:
Asc(string)
string必要的参数,可以是任何有效的字符串表达式。解题步骤:
第一步:编写程序代码。
程序提供的代码:
Private Sub CA_Click()
Dim strinfo As String
’ "inG.txt" For Input As A
Input #A, strinfo
Close #A
TextA.Text=strinfo
End Sub
Private Sub CommandB_Click()
Dim strchange As String
Dim i As Integer
For i=A To Len(TextA.Text)
’ strchange=strchange+(Asc(Mid(TextA.Text, i, A) ) +B)
Next
TextA.Text=strchange
End Sub
Private Sub CommandC_Click()
Open "outG.txt" For Output As A
’Print #A,
Close #A
End Sub
参考代码:
Private Sub CA_Click()
Dim strinfo As String
Open "inG.txt" For Input As A
Input #A, strinfo
Close #A
TextA.Text=strinfo
End Sub
Private Sub CB_Click()
Dim strchange As String
Dim i As Integer
For i=A To Len(TextA.Text)
strchange=strchange+Chr(Asc(Mid(TextA.Text, i, A) ) +B)
Next
TextA.Text=strchange
End Sub
Private Sub CC_Click()
Open "outG.txt" For Output As A
Print #A, TextA.Text
Close #A
End Sub
第二步:调试并运行程序
第三步:按题目要求存盘

阅读理解

根据短文内容,从短文后的选项中选出能填入空白处的最佳选项,选项中有两项为多余选项。

The Winner’s Guide to Success

How do successful people think? What helps them to make success? To find out the answers, an American scholar recently visited some of the most successful people in America.    小题1:  

Be responsible for yourself

Sometimes you may want to blame others for your failure to get ahead.    小题2:    You’re saying, “You have more control over my life than I do.”

Live life “on purpose”

Almost all successful people live life “on purpose”— they are doing what they believe they should and want to do. When you live your life on purpose, you’ll try your best to do your job or study as well as you can. You love what you do and you can find pleasure in what you do.

Write a plan

It is very difficult trying to get what you want without a good plan.     小题3:    A good plan is like a map to you. Without this “map”, you may waste your time, money and also your energy; while with the “map” you’ll enjoy the “trip” and get what you want in the shortest possible time.

Be willing to pay the price

Nothing great is easy to get. So you must be ready to work hard — even harder than you have ever done. If you are not willing to pay the price, you won’t get anything valuable.

Never give up

  小题4:   When you are doing something, you must tell yourself again and again: Giving up is worse than failure because failure can be the mother of success, but giving up means the death of hope.

  小题5:   

Once an American writer was writing a novel. He could not have a good ending for his book until one night when he had a very good idea. He was so excited that he made a phone call to one of his best friends. “I’ve got a perfect idea,” he said, “I’ll put it down later and show it to you.” But he never did, because he died that night. His book was left without a perfect ending. So remember, do what you can right away. Never delay at all.

A.In fact, when you say someone or something outside of yourself is stopping you from making success, you’re giving away your own power.

B.It is just like trying to drive through strange roads to a city far away.

C.Some people achieve success much later in life because they fail to realize earlier the importance of hard work.

D.Here are some keys to success that they give.E. Someone else’s opinion of you doesn’t have to become your reality.

F. It seems to us that everyone knows this. But it is easier said than done.

G. Don’t delay

多项选择题