VB语言程序设计试卷A

上传人:仙*** 文档编号:136484926 上传时间:2022-08-16 格式:DOC 页数:230 大小:1.34MB
收藏 版权申诉 举报 下载
VB语言程序设计试卷A_第1页
第1页 / 共230页
VB语言程序设计试卷A_第2页
第2页 / 共230页
VB语言程序设计试卷A_第3页
第3页 / 共230页
资源描述:

《VB语言程序设计试卷A》由会员分享,可在线阅读,更多相关《VB语言程序设计试卷A(230页珍藏版)》请在装配图网上搜索。

1、 2013年春季学期VB语言程序设计试卷 A命题教师命题组系主任审核考试形式闭卷考试类型 学位课 非学位课 (请打选择)考试班级管院12级考试日期2013年 6 月 8日考试时间2小时班 级姓名学号成绩 注意:1命题时请适当留答题位置。请用深蓝色墨水书写,字、图清晰,书写不出边框。 2答题演草时不许使用附加纸,试卷背面可用于演草。试卷不得拆开。 一、单项选择题(本大题共20小题,每小题1分,共20分)1. 与传统的程序设计语言相比,Visual Basic最突出的特点是( C )。 A. 结构化程序设计 B. 程序开发环境C. 事件驱动的编程机制 D. 程序调试技术2. 以下能在窗体Form1

2、的标题栏中显示VisualBasic窗体的语句是( A )。A. Form1.Caption =VisualBasic窗体B. Form1.Title=VisualBasic窗体C. Form1.Name =VisualBasic窗体D. Form1.Text=VisualBasic窗体3. 在VB中,使用变量x存放数据87654321.123456,应该将x声明为( B )类型。A. 单精度(Single) B. 双精度(Double)C. 长整型(Long) D. 货币型(Currency)4. 在VB中,设x=10,y=50,要求生成一个字符串变量s,其值为10*50=500,其中数字由

3、变量x和y的值或表达式来表示,正确的是( C )。A. s=x*y= & x*yB. s=x & * & y & = & x*yC. s=x & “* & y & = & x*yD. s=x + * + y + = + x*y 教务处印制 共 14 页 (第 1 页)5在VB中,假设已使用如下变量声明语句:Dim date1 as date 则为变量date1正确的赋值的语句是( B )。 Adate1=date(”8/6/2013 ”) Bdate1=#8/6/2013# Cdate1=8/6/2013 Ddate1=” #8/6/2013#” 6在VB中,要判断在文本框是否按了Enter键

4、,应在文本框的( D )事件中判断。 AChangeBKeyDownCClickDKeyPress7在VB中,对于语句If x=1 Then y=1,下列说法正确的是( C )。 Ax=1 和 y=1 均为赋值语句Bx=1 和 y=1 均为关系表达式Cx=1 为关系表达式, y=1 为赋值语句Dx=1 为赋值语句, y=1 为关系表达式8. 下面VB语言的If语句统计满足性别为男、职称为副教授以上、年龄小于40岁条件的人数,不正确的语句是( D )。AIf sex=男And age40 And (duty=教授Or duty=副教授) Then n=n+1BIf sex=男And age40

5、And InStr(duty,教授)0 Then n=n+1CIf sex=男And age40 And Right(duty,2)= 教授 Then n=n+1DIf sex=男And age40 And duty=教授And duty=副教授 Then n=n+19. 在VB中,下列程序段的运行结果(即 s 的值)是( B )。 s = 0 For k = 5 To 25 Step 7 s = s + k Next k Print s A. 26 B. 36 C. 37 D. 6110. 在VB中,读取列表框中的第三个表项值,并把值赋值给变量x,下面的语句不能采用的是( B )。 Ax=l

6、ist1.list(2) b. x=list1.text(2) C. list1.selected(2)=true D. list1.listindex=2 x=list1.text x=list1.text11在VB中,一个数组说明为Dim a(0 to 5,1 to 5) As Integer,则该数组共有( C )个元素。A. 25 B. 36 C. 30 D. 不确定 教务处印制 共 14页 (第 2 页)12在VB中,默认的数组下标的下界从0开始,要想在通用声明段界定下界,则应使用( A )。 A. Option Base B. Option Explicit C. Explicit

7、 D. Low Base13在VB中,要使用过程调用后返回两个参数s和t,下列的过程定义语句中,正确的是(C )。ASub Mysub1(ByRef s, ByVal t) BSub Mysub1(ByVal s, ByVal t)CSub Mysub1(ByRef s, ByRef t) DSub Mysub1(ByVal s, ByRef t)14在过程定义的变量,若希望在离开该过程后,还能保存过程中局部变量的值,则应使用( A )关键字在过程中定义局部变量。 ADim BPrivate CPublic DStatic15在VB中,以下叙述中错误的是( D )。 A如果过程被定义为Stat

8、ic类型,则该过程中的局部变量都是Static类型BSub过程中不能嵌套定义Sub过程CSub过程中可以嵌套调用Sub过程D事件过程可以像通用过程一样由用户定义过程名16在VB中,调试程序的工作重点是( B )。A证明程序的正确性B检查和纠正程序错误 C优化程序结构 D提高运行效率17在VB中,如果有2组单选按钮建立在2个框架中,运行时可以同时选中( B )个单选按钮。A1 B2 C3 D418在VB中,下列关于菜单的叙述,错误的是( C )。A每个菜单项都是一个控件,与其他控件一样也有其属性和事件B菜单项只能识别Click事件C不能在顶层菜单上设置快捷键D在程序的运行过程中,不可以重新设置菜

9、单项的Visible属性19下面哪个属性可以控制菜单项可见或不可见( C )。 AHide BChecked CVisible DEnabled20在VB中,在MouseDown和MouseUp事件中,当参数Button为1时,代表按下( A )键。A左 B右 C中 D没有按键 教务处印制 共 14 页 (第 3 页)二、填空题(本大题共10小题,每小题1分,共10分)1 VB提供两种运行程序的方式,一种是解释方式,一种是_编译_方式。2在VB中,如果要产生1000-9999范围内(含1000及9999)的随机整数,采用的VB表达式是_ Int(Rnd*9000+1000)_。3下列语句执行后

10、,s的值是_大学西安_。 t=”西安理工大学” s=Right(t,2) +Left(t,2)4在VB中,如果要使计时器每分钟触发一个Timer事件,则Interval属性应设置为_60000_。5在VB中,要使文本框Text1获得焦点,应执行的语句是:_。 6sin50o 写成的表达式为_。7. VB数据传递方式有两种:值传递和_传递。7在VB集成开发环境中有3种工作模式:设计模式、运行模式和_。9下列的程序段执行后,语句s的值为_。S=0For m=1 to 3 n=1 do while n=m s=s+n n=n+1 loopnext m10假定输入的x的值是10,下面程序段运行的结果是

11、_。 x = Val(InputBox(Enter x) Select Case Sgn(x) + 2 Case 1 x = x + 1 Case 2 x = x + 2 Case 3 x = x + 3 End Select Print x + 1 教务处印制 共 14 页 (第 4 页)三、程序分析题(本大题共6小题,每小题5分,共30分)1.分析下面的程序,在form1中Text1、Text2和Text3已经设置好,在程序的运行过程中,在前两个文本框中输入值,请写出程序的的功能。 Private Sub Command1_Click() Dim m As Integer, n As In

12、teger, p As Integer m = Val(Text1.Text) : n = Val(Text2.Text) If m = 0 Or n = 0 Then MsgBox (数据错误!) End End If Do p = m Mod n m = n n = p Loop While p 0 Text3.Text = m End Sub该程序的功能为_。 教务处印制 共 14 页 (第 5 页) 2.取一元、二元、五元的硬币共十枚,付给25元钱,有多少种不同的取法?。请分析下面的程序,并补充程序的划线处。分析:分析:设一元硬币为a枚,二元硬币为b枚,五元硬币为c枚,可列出方程 采用

13、两重循环,外循环变量a从010,内循环变量b从010。用户界面如下图所示。 Private Sub Form_Load() Show CurrentX = 0: CurrentY = 1500 Print , 五元, 二元, 一元 n = 0 For a = 0 To 10 For b = 0 To 10 c = _ If _ And c = 0 Then n = n + 1 Print (; n; ), c, b, a End If Next bNext a End Sub 教务处印制 共 14 页 (第 6 页)3下面程序的功能是对已知数组a,删除数组中数组元素中某个元素。要删除的数组元素

14、的值由Inputbox输入,请分析下面的程序,并填空。Private Sub Command1_Click()Dim a() as variantDim key as integer, i as integer, j as integera = Array(1, 6, 8, 3, 5, 9, 10, 2, 7, 4)key = Val(InputBox(输入要删除的值)For i = 0 To 9If _ Then For j = i + 1 To 9 _ Next j ReDim Preserve a(8) MsgBox (删除完成) Exit SubEnd IfNext iMsgBox (

15、找不到要删除的元素)End Sub 教务处印制 共 14 页 (第 7 页)4. 分析下面的程序,假定输入的数据依次为1,2,3,4,5,6,7,8,9。 Private Sub Form_Click()Dim a(1 to 3, 1 to 3) as integerDim m as integer, n as integer,max as integerFor i = 1 To 3 For j = 1 To 3a(i, j) = Int(InputBox(输入要数组元素的值) Next jNext iFor i = 1 To 3 For j = 1 To 3 Print a(i, j); N

16、ext j PrintNext imax=a(1,1)m=1n=1For i = 1 To 3 For j = 1 To 3 If max a(j) Then t = a(i): a(i) = a(j): a(j) = t End If Next j Next i Print 排序结果: For i = 1 To 10 Print a(i); Next i End Sub教务处印制 共14 页 (第 13 页)4. 编写程序求解s=1!+2!+3!+10!的值,要求把求解n!定义成一个function过程,然后通过主程序调用求解,主调程序在Form_Load事件中实现。Private Sub

17、Form_Load()Dim y As Long, s As Long Show S=0For i =1 to 10 S=s+fac(i)Next i Print 1! + 2! +10!=; sEnd SubPrivate function fac(n As Integer) as long Dim i As Integer, t as long t = 1 For i = 1 To n t = t * i Next i Fac=tEnd Sub教务处印制 共14页 (第 14 页)(英文版 ) easily blame, to prevent the broken window effec

18、t. Supervise the leading cadres to play an exemplary role, take the lead in the strict implementation of the and , lead to safeguard the solemnity and authority of the party discipline, ensure that the party discipline and the laws and regulations for implementation in place. Throughout the discipli

19、ne in the daily supervision and management, strengthen supervision and inspection, from the thorough investigation of violations of discipline behavior. Strengthen to key areas, key departments and key projects as well as the masses reflect the concentration of the units and departments for supervis

20、ion. - strengthening supervision, discipline inspection and supervision of cadres to set an example for compliance with the and is a man must be hexyl, blacksmith needs its own hardware. Discipline inspection organs as the executor of the party discipline, and supervisor of the defenders, for its su

21、pervision must be more strictly, discipline inspection and supervision of cadres to firmly establish the awareness of Party Constitution, sense of discipline and rules consciousness, politics loyalty, sense obey. Action speak Ji Ordinance to set an example of the regulations of the rule of law, stre

22、ngthen supervision and accept the supervision of the firmness and consciousness, do comply with and . To firmly establish the discipline must first be disciplined, the supervisor will be subject to the supervision of concept, and consciously safeguard and implement party compasses party, take the le

23、ad in practicing three strict real strict, so loyal, clean, play. To be good at learning, the Constitution and the as morality, politics and brought to fruition; to implement , do not want to, dare not, not with disciplinary ruler to supervision; to discipline a ruler, often the control inspection,

24、and consciously in the ideological red line to draw the row Ming Good accumulation is indeed the bottom line, so that the heart has fear, said to have quit, the line has ended. Attached: indifferent to heart, calmly to the table in our life, there are many unpredictable things will happen, some good

25、, some bad things, we cannot control is powerless to stop, but with time, you will find in life sometimes turns out to be not good, some bad things finally turned out to be a good thing, but then we muddy however did not know, this is the life teach us things. 1, life can be complex, can also be sim

26、ple. Want simple life of precipitation, to have enough time to reflect, to make Become more perfect. Life is the most important thing is not to win, but the struggle; not to have conquered, but to have fought well. 2, the plain is the background of life. Live a plain life, give up on themselves is n

27、ot a coward, but the wise answers; not disillusioned after the heart, such as ashes, but experience the storm after the enlightenment; not unrewarding perfunctorily, but calm attitude of life of unrestrained self-confidence. Plain living, there is no noise noisy, no earthly troubles, more did not fi

28、ll in the discontent of desire, some just a calm, a calm. 3, memory of heart will not good things to erase the, life is a When no movie, pain is a beginning, the struggle is a kind of process, death is a kind of ending. Give up this giving up is the helpless, do not give up the abandoned, do not giv

29、e up this giving up is ignorance, do not give up should not give up is persistent. 4, a thing figured is heaven, think impassability is hell. Since the living, to live better. Sometimes we because of too narrow-minded, too care around the chores and penny wise and pound foolish, not worth the candle

30、. Some things to attract trouble and worry, completely depends on how we look at and deal with it. Dont always take everything back to things, and dont get into a blind alley, dont want to face, dont be narrow-minded. Poke to care, is a kind of open-minded, a free and easy. 5, I am not afraid of oth

31、ers behind me a knife, I afraid to look back and see stab me, is my intention to treat people; I am not afraid of the truth to tell the best friend, Im afraid he turned to it as a joke to tell dont 6, when we are in a positive frame of mind, you will find many good things; and when we are in a negat

32、ive state of mind, you will find many depressed things; life happy and worry, all is you of life attitude, optimistic, good luck; loss of sink, Eritrea company. When you are in adversity, may wish to change a point of view to think everything over to the good Think, because good mentality decided th

33、e fate of the! 7, people are tired, rest; heart tired, calm. Grow up, mature, this society read. Tired and sad, squat down, to their a hug. Because the world no one can sympathize with you, have mercy on you. You cry, tears is your own; you pain, no one can understand. Then you only tears to smile.

34、8, each people have youth,Each youth are a story, the life of the world never gets easier, I want what, wish the world all know, as has been the same; now want anything, for fear that others know, or like to lose the same. 9, the heart move, everything in the world is followed by birth, Rangrang, im

35、portant thing is often the most difficult to open ones mouth, because words will reduce its importance; to let strangers people care about your life in the good things, the original is not easy 10, do not blame, do not laugh at who, also dont envy who. Like a person is a kind of feeling, not like a

36、person is true. The truth is easy to explain, I feel Is unspeakable. The best travel life is that you in a strange place found a long lost touched. 11, happy life not in the bustling in, and in the peace of mind; no matter how many grievances, how uncomfortable, and ultimately to heal themselves or

37、their own, others may got you to comfort, but never know your heart is how wanjianchuanxin. 12, maam, like a movie, learn to appreciate, learn to be grateful, learn tolerance, and goodness, helping others. Instead of accusing the society, as into one; and an exception is better to give than to what

38、13, dont envy him A sum of, dont lose your life and the life, respectively is: the former is a we experienced cannot escape in a day finally will last minute, while the latter is our persistent, we want to cherish the memory of those people and things. 14, learn to smile, learn to strong, the world

39、you know so many people, so many people and you are, you cannot change also cant let everyone like you, so also do not want to do. Life is too short to go crazy to love to go to waste, to chase the dream to regret. 15, when temper, a blessing to go. A wounding elegant people, the key is to control t

40、heir own emotions. With the mouth is the most stupid behavior. A control negative emotions than a can take a city more powerful water flow slow, language is expensive. People spent two years of time to learn to speak, but to spend a few years time to shut up. That is a kind of ability, that is a kin

41、d of wisdom. 16, life is not perfect, sometimes, growth is not a cry, not an eyeful of tears, there is no trace of emotion, there is no gleam of hope, no desire, no action, no static, there is only one kind of downward sinking feeling, sink A murky? 6? 7? 6? 7 sink? 6? 7? 6? 7 toward the bottom of t

42、he sink. 17, in some way, do not go, you will not know the other side scenery is beautiful. To you is not good, you do not mind too much, no one has an obligation to you; you learn knowledge, is you have weapons, you can start from scratch, but not unarmed; how do you treat people, does not represen

43、t how others treat you, if cannot see through this point, only inviting worry. 18, time is like a sponge in the water, as long as you are willing to squeeze, the total water is still there. Every life, after the ups and downs The best test of live, to life, survival and continuation, do not stop the

44、 struggle in the joys and sorrows of life on the road, so that different soul to bear life beat, acceptance of suffering. 19, indifferent to heart, calmly in table, elegant and comfortable life, do not take what is so important. The pursuit will be disappointed; to be alive, you will have trouble. L

45、ife is the most afraid of what all want to care about, but also what all grasp is not firm, without scenery, separated populations, such as not to desire, all docked in the fate of the end. Why is too rigid, the natural, to go stay not to live, let go of obsession, revel is 20, if the fate of the br

46、oken Hopes of sailing, please dont despair, the coast is still, if the fate of the withered petals of the beautiful, please do not sink, the spring is still, life will always be endless trouble, please dont helpless, because they are still alive, is still a dream, the sun still, we still. Lost, keep

47、 memories; to get, must work to; but the most important is good to cherish their own. 21, life, select the complex, is to choose the pain; choose a simple, is choose to be happy. The complex world like aSignificance of pride. Hope is the ornate palace, outside people admiring the magnificent, living

48、 in the deep knowledge of living it to pay the price. Simple world as a simple log cabin outside ridiculed shabby, the heart is willing to go live to know the joy. Suffering and joy is their own choice. 22, learn how to use a single powerful heart, let the past be the past, let the future come. Life

49、 is really the end of the end of an eagle is flying wings, life is constantly pursuit. Dont miss to regret, dont wait for old just miss. Time to return, seize every moment, again painstakingly again tired also Those struggling to fly. 23, life could not Yimapingchuan, even flat pavement, inevitably

50、there will be a few pieces of roadblocks. Some of the rocks around the past, while others have to move it out. Just move others put the stone is very easy, because the stone from the appearance we can discern; difficult to myself to move away the heart of stone head. Leave time to spend with her, often reflect my heart, so as to remove your heart of stone. 24, everything does not have to be demanding, come to, everything does not have to care ab

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!