2017年11月21日 星期二

[ VB2010 ] - 008 條件判斷流程 001

[ VB2010 ] - 008 條件判斷流程 001

●對與錯:

●用電腦運算對與錯:

 

Public Class Form1

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As Boolean, b As Boolean

        a = True
        b = False
        TextBox1.Text = "地球比月球大 is " & a
        TextBox2.Text = "地球比木星大 is " & b
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim moon, earth, jupiter As Integer
        Dim a, b As Boolean
        moon = 1738 : earth = 6378 : jupiter = 71492

        a = earth > moon
        b = earth > jupiter
        TextBox3.Text = "地球比月球大 is " & a
        TextBox4.Text = "地球比木星大 is " & b

    End Sub
End Class

沒有留言:

張貼留言

2024_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...