Posted under Visual Basic
f(x)=ax²+bx+c parabolündeki a,b,c değerleri için 3 adet textbox, 8 tane label kullanılacak program kodları şöyle
Dim a
Dim b
Dim c
Dim del
Dim x1
Dim x2
Dim range
Dim dela
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
del = b * b - (4 * a * c)
‘*********************************************************************************************
If del >= 0 Then
x1 = Round((-b + Round(Sqr(del), 3)) / Abs(2 * a), 4)
x2 = Round((-b - Round(Sqr(del), 3)) / Abs(2 * a), 4)
Label4.Caption = “Kökler = ” & x1 & ” , ” & x2
Else
dela = Abs(del)
x1 = Round(-b / Abs(2 * a), 4) & “+” & Round(Round(Sqr(dela), 4) / Abs(2 * a), 4) & “i”
x2 = Round(-b / Abs(2 * a), 4) & “-” & Round(Round(Sqr(dela), 4) / Abs(2 * a), 4) & “i”
Label4.Caption = “Kökler = ” & x1 & ” , ” & x2
End If
‘*********************************************************************************************
Label5.Caption = “f(x) Vertex = (” & Round(-b / (2 * a), 4) & ” , ” & Round(-del / (4 * a), 4) & “)”
‘*********************************************************************************************
Label6.Caption = “f(x) Simetri ekseni = ” & -b / 2 * a
‘*********************************************************************************************
Label7.Caption = “f(x) Tanım kümesi = R”
‘*********************************************************************************************
If a > 0 Then
range = “( + sonsuz , ” & Round(-del / (4 * a), 4) & ” ]”
Else
range = “[ ” & Round(-del / (4 * a), 4) & ” , - sonsuz)”
End If
Label8.Caption = “f(x) Değer kümesi = ” & range
End Sub
Private Sub Label7_Click()
End Sub