(完整word版)福建省计算机二级VB编程题

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1编程题【1】26-01N=Val(Text1.Text)SelectCaseNCase80To100Text2.Text=优良Case60To79Text2.Text=合格Case0To59Text2.Text=不合格EndSelect【2】25-01Dimi%,s&N=Val(Text1.Text)s=0Fori=1ToNIfiMod2=0Thens=s+iNextiText2.Text=Str(s)【3】24-012DimiAsIntegerN=Val(Text1.Text)Text2.Text=Fori=NTo1000IfiMod8=1ThenText2.Text=Text2.Text&i&Nexti【4】23-01DimiAsIntegers=0N=Val(Text1.Text)Fori=1ToNs=s+i^iNextiText2.Text=s【5】22-01Dimi%,n%,aAsString*1n=03Fori=1ToLen(Text1.Text)a=Mid(Text1.Text,i,1)Ifa=0Anda=9Thenn=n+1NextiText2.Text=Str(n)【6】21-01DimaAsDouble,bAsDouble,cAsDouble'保留本行定义a=Val(Text1.Text)b=Val(Text2.Text)c=Val(Text3.Text)Ifb^2-4*a*c=0ThenText4.Text=实数解ElseText4.Text=复数解EndIf【7】20-014N!S=1Fori=1tonS=s*iNexti1+1!+2!+3!+。。。+n!Dimi%,t&,n%,s&n=val(text1.text)t=1s=1Fori=1tons=s*it=t+1.0/sNextiDimiAsInteger,jAsInteger,sAsLongN=Val(Text1.Text)Text2.Text=Str(e)【8】19-015DimNAsInteger,sAsSingle'保留Dimi%N=Val(Text1.Text)s=0Fori=1ToNs=s+(-1)^(i+1)/iNextiText2.Text=Str(s)【9】18-01Dimi%Text1.Text=Fori=100To200IfiMod3=0AndiMod60ThenText1.Text=Text1.Text&i&Nexti【10】17-01DimA(1To20)AsInteger,iAsIntegerText1.Text=Text2.Text=RandomizeFori=1To20A(i)=Int(Rnd*90+10)Text1.Text=Text1.Text&A(i)&6Text2.Text=Text2.Text&IIf(A(i)=65AndA(i)=90,Chr(A(i))&,)Nexti【11】27-02PrivateSubCommand1_Click()'不得删改本行注释RandomizeText1.Text=Int(Rnd*9000+1000)EndSubPrivateSubCommand2_Click()'不得删改本行注释Dimi%,s%s=0Fori=1ToLen(Text1.Text)s=s+Val(Mid(Text1.Text,i,1))NextiText2.Text=Str(s)EndSub【12】23-02PrivateSubCommand1_Click()'不得删改本行注释DimiAsIntegerText2.Text=Fori=1ToLen(Text1.Text)7Text2.Text=Mid(Text1.Text,i,1)&Text2.TextNextiEndSub【13】22-02PrivateSubcommand1_click()'''不得删改本行注释Dimi%,chrAsString*1Text3.Text=Fori=1ToLen(Text1.Text)chr=Mid(Text1.Text,i,1)IfchrText2.TextThenText3.Text=Text3.Text&chr'或者Ifchr=Text2.TextThenText3.Text=Replace(Text1.Text,chr,)NextiEndSub27-01Dimi%Dimn%n=Val(Text1.Text)Fori=1TonLabel2.Caption=Label2.Caption+SjzfNextiFunctionSjzf()AsStringDimkAsIntegerRandomizek=Int(Rnd*2)Ifk=0ThenSjzf=Chr$(Int(Rnd*26)+65)ElseSjzf=Chr$(Int(Rnd*26)+97)EndIf8EndFunction

1 / 8
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功