vb编写各种趣味小程序,VB编个小程序

1,VB编个小程序新建一个label1控件和text1控件和text2控件 。text1输入月份,text2输入日,label1显示出来 。if (CINT(text1)=1 and CINT(text2)>=15 and CINT(text2)<=30) or (CINT(text1)=2 and CINT(text2)>=1 and CINT(text2)<=15) thenlabel1="你的星座是双子座 。配对是XXX座"else if ............else if ............else 出错信息 。end if其他的都按照第一个格式去做 。【vb编写各种趣味小程序,VB编个小程序】
2,用计算机VB语言编一个小程序dim b(1 to 100) as bytefor i= 1 to 100b(i)=int(rnd*89+10)nextfor i=1 to 100if b(i)<=40 thent1=t1+1elseif b(i)>70 thent3=t3+1elset2=t2+1endifnextprint t1;tab(10);t2;tab(20);t3dim a(1 to 100)showfor i = 1to 100randomizea(i) = int(90*rnd+10)next ifor i = 1 to 100if a(i) < 40 thenx = x+1elseif a(i) >= 40 and a(i)< 70 theny=y+1elseif a(i) >= 40 and a(i)<70 theny=y+1elseif a(i) >= 70 thenz=z+1
3 , 在VB中制作一个小小的程序Private Sub Command1_Click()If Val(Text1.Text) < 0 Or Val(Text1.Text) > 200 ThenMsgBox "错误"ElseIf Val(Text1.Text) <= 100 ThenMsgBox "1"ElseMsgBox "2"End IfEnd Sub测试通过Private Sub Command1_Click()a = Val(Text1.Text)Select Case aCase 0 To 100MsgBox "1"Case 101 To 200MsgBox "2"Case ElseMsgBox "错误"End SelectEnd SubPrivate Sub Command1_Click()If Val(Text1.Text) < 0 Or Val(Text1.Text) > 200 ThenMsgBox "错误"ElseIf Val(Text1.Text) <= 100 ThenMsgBox 1ElseIf 101 <= Val(Text1.Text) <= 200 ThenMsgBox 2ElseEnd IfEnd IfEnd IfEnd Sub

    推荐阅读