This document contains the code for a form application that calculates totals from input values. It defines functions to calculate totals, clear fields, and display results. The form allows entering values, clearing fields, saving results, and closing the application.
This document contains the code for a form application that calculates totals from input values. It defines functions to calculate totals, clear fields, and display results. The form allows entering values, clearing fields, saving results, and closing the application.
Sub pesan() Dim Ps2 As Decimal Dim ps1 As Decimal Dim ps As Decimal Dim total As Decimal Ps2 = Val(txtTS2.Text) ps1 = Val(txtTS1.Text) ps = Val(txtTS.Text) total = Ps2 + ps1 + ps Label6.Text = "Terima kasih: " & Chr(13) & "Program Studi Anda: " & cboProdi.Text & "Jumlah PS2 :" & txtTS2.Text & "jumlah PS1 :&" & txtTS1.Text & "jumlah PS :&" & txtTS.Text & "Total :&" & total End Sub Sub blank() cboProdi.Text = "" cboJenis.Text = "" txtTS2.Text = "" txtTS1.Text = "" txtTS.Text = "" End Sub Private Sub cmdTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTutup.Click End End Sub Private Sub cmdHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdHapus.Click Call blank() Label6.Text = "" End Sub
Private Sub cmdSimpan_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSimpan.Click Call pesan() Call blank() End Sub End Class
Aim_Write a program in VB that constructs a scientific calculator with Sine, Cosine, Tangent, Logarithm, 1_x (Reciprocal), and sqr (Square root) functions