Ana içeriğe atla

İkinci Dereceden Denklem Çözümü

İkinci Dereceden Denklem Çözümü

Gerekenler: 3 Metin Kutusu 1 Buton
Private Sub Komut6_Click()
Dim a, b, c, d, sx, sy, dk As Double
Metin0.SetFocus
a = Val(Metin0)
Metin2.SetFocus
b = Val(Metin2)
Metin4.SetFocus
c = Val(Metin4)
d = (b * b) - (4 * a * c)
If d < 0 Then
MsgBox ("Kök Yoktur.")
ElseIf d = 0 Then
sx = -b / 2 * a
sy = sx
MsgBox ("X1=X2" & Chr(13) & "X1=" & sx & Chr(13) & "X2=" & sy)
Else
sx = Round((-1 * b + Sqr(d)) / (2 * a), 1)
sy = Round((-1 * b - 1 * Sqr(d)) / (2 * a), 1)
MsgBox ("X1=" & sx & Chr(13) & "X2=" & sy)
End If
End Sub






Yorumlar

Bu blogdaki popüler yayınlar

Accessde İfade Oluşturucu Fonksiyonları

Fonksiyonlar ve Kullanımı boş form seçeneği ile yeni bir form oluşturulur.Oluşan form tasarım görünümüyle açılır. iki ayrı metin kutusu eklenir özellik Sayfası seçilir. Özellik Sayfasından tümü/Denetim Kaynağının yanındaki ... tıklanır.İfade oluşturucudan fonksiyon seçilir.

Dosyadaki verileri tabloya aktarma

Option Compare Database Sub akt() Dim db As Database Dim rst As Recordset Set db = CurrentDb() Set rst = db.OpenRecordset("Tablo1") Open "d:\ak.txt" For Input As #1 Do While Not EOF(1) rst.AddNew Input #1, ad, soyad, yaş rst("ad").Value = ad rst("soyad").Value = soyad rst("yaş").Value = yaş rst.Update Loop Close #1 End Sub

Hesaplama

Sub hesapla() Dim db As Database Dim rst As Recordset Set db = CurrentDb toplam = 0 Set rst = db.OpenRecordset("giriş") Do Until rst.EOF If rst.Fields(2).Value = "teknosa" Then toplam = toplam + (rst.Fields(3).Value * rst.Fields(4).Value) End If rst.MoveNext Loop MsgBox toplam End Sub