Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim h, s As Single
        h = InputBox("請輸入華氏溫度", "華氏轉攝氏")
        s = 5 / 9 * (h - 32)
        MsgBox("攝氏溫度為" & s, , "華氏轉攝氏")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim h, s As Single
        s = InputBox("請輸入攝氏溫度", "攝氏轉華氏")
        h = 9 * s / 5 + 32
        MsgBox("華氏溫度為" & h, , "攝氏轉華氏")
    End Sub
End Class
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 台中家商 小柯 的頭像
    台中家商 小柯

    小柯的文章貼簿

    台中家商 小柯 發表在 痞客邦 留言(0) 人氣()