You are on page 1of 3

TUGAS PROGRAM DAN APLIKASI KOMPUTER

APLIKASI PERHITUNGAN ABC

Nama : Aledien Mandala Aji


NIM : 030211817220
Kelas :B
Kampus : Indralaya

TEKNIK PERTAMBANGAN
FAKULTAS TEKNIK
UNIVERSITAS SRIWIJAYA
2018
Source Code :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim nilaiA, nilaiB, nilaiC, nilaiD, nilaix1, nilaix2 As Single
nilaiA = TextBox1.Text
nilaiB = TextBox2.Text
nilaiC = TextBox3.Text
nilaiD = nilaiB ^ 2 - (4 * nilaiA * nilaiC)

If nilaiD > 0 Then


nilaix1 = (-nilaiB + Math.Sqrt(nilaiD)) / 2 * nilaiA
nilaix2 = (-nilaiB - Math.Sqrt(nilaiD)) / 2 * nilaiA
TextBox4.Text = nilaix1
TextBox5.Text = nilaix2

ElseIf nilaiD = 0 Then


nilaix1 = -nilaiB / 2 * nilaiA
nilaix2 = -nilaiB / 2 * nilaiA
TextBox4.Text = nilaix1
TextBox5.Text = nilaix2

ElseIf nilaiD < 0 Then


TextBox4.Text = "Imaginer"
TextBox5.Text = "Imaginer"
End If

'If nilaiD < 0 Then


'TextBox4.Text = "Imaginer"
'TextBox5.Text = "Imaginer"
'End If

End Sub
End Class
Bukti :