Modul VB – Latihan Program Phitagoras


Soal Latihan VB

Buatlah program menghitung sisi miring (rumus Phitagoras)
Input : a, b
Output : c = Sqr(a^2 + b^2)

Modul VB - Program Rumus Phitagoras

Modul VB - Program Rumus Phitagoras

Jawaban

Pengkodean:
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Sqr(a ^ 2 + b ^ 2)
Text3.Text = c
End Sub

Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Iklan

6 thoughts on “Modul VB – Latihan Program Phitagoras

  1. assalamualaikum pak, mohon untuk contoh tugas VB’y yang phitagoras mohon di lengkapi y pak, biar bisa n ga buat bapak cape pas njelasin di kelas. hehehehehe
    terimakasih banyak waassalamualaikum.

  2. Assalamuailakum Pak Fairuz.
    Pak makasih banyak ya . Rasanya seneeeeeeeng banget …. sdah dpat pengkodean phitagoras itu…

    wass..;.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s