Public Class Form1
Private Sub btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhitung.Click
Dim pilihan As String = ComboBox1.Text
Dim besar_sudut As Double = TextBox1.Text
Dim radian As Double = besar_sudut / 180 * Math.PI
Dim sin As Double = Math.Sin(radian)
Dim cos As String = Math.Cos(radian)
Dim tan As String = Math.Tan(radian)
If pilihan = "Sinus" Then
ListBox1.Items.Add("Nilai Radian = " & radian & " maka hasil Sinus = " & sin)
ElseIf pilihan = "Cosinus" Then
ListBox1.Items.Add("Nilai Radian = " & radian & " maka hasil Cosinus = " & cos)
ElseIf pilihan = "Tangen" Then
ListBox1.Items.Add("Nilai Radian = " & radian & " maka hasil Tangen = " & tan)
End If
End Sub
End Class
Komentar
Posting Komentar