Eski 12-05-04, 22:43 #1
Xenonz Xenonz çevrimdışı
Varsayılan çok acil neden hep 0 veriyo sonucu (visual basic.NET)

işte program bu rasgele sayılar girsemde daima 0 cevabını veriyo domein odevini vermezsem sınava giremicem



Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents txb As System.Windows.Forms.TextBox
Friend WithEvents txa As System.Windows.Forms.TextBox
Friend WithEvents txc As System.Windows.Forms.TextBox
Friend WithEvents txa1 As System.Windows.Forms.TextBox
Friend WithEvents txb1 As System.Windows.Forms.TextBox
Friend WithEvents txc1 As System.Windows.Forms.TextBox
Friend WithEvents txx As System.Windows.Forms.TextBox
Friend WithEvents txx1 As System.Windows.Forms.TextBox
Friend WithEvents Txh As System.Windows.Forms.TextBox
Friend WithEvents txz As System.Windows.Forms.TextBox
Friend WithEvents txy As System.Windows.Forms.TextBox
Friend WithEvents Label12 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txa = New System.Windows.Forms.TextBox
Me.txb = New System.Windows.Forms.TextBox
Me.txc = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.txa1 = New System.Windows.Forms.TextBox
Me.txb1 = New System.Windows.Forms.TextBox
Me.txc1 = New System.Windows.Forms.TextBox
Me.Label6 = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.Label8 = New System.Windows.Forms.Label
Me.Label9 = New System.Windows.Forms.Label
Me.Label10 = New System.Windows.Forms.Label
Me.txx = New System.Windows.Forms.TextBox
Me.txx1 = New System.Windows.Forms.TextBox
Me.Label11 = New System.Windows.Forms.Label
Me.Txh = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.txy = New System.Windows.Forms.TextBox
Me.txz = New System.Windows.Forms.TextBox
Me.Label12 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(56, 120)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(32, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Y1="
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(59, 167)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(32, 16)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Y2="
'
'txa
'
Me.txa.Location = New System.Drawing.Point(96, 112)
Me.txa.Name = "txa"
Me.txa.Size = New System.Drawing.Size(24, 20)
Me.txa.TabIndex = 2
Me.txa.Text = ""
'
'txb
'
Me.txb.Location = New System.Drawing.Point(160, 112)
Me.txb.Name = "txb"
Me.txb.Size = New System.Drawing.Size(24, 20)
Me.txb.TabIndex = 3
Me.txb.Text = ""
'
'txc
'
Me.txc.Location = New System.Drawing.Point(216, 112)
Me.txc.Name = "txc"
Me.txc.Size = New System.Drawing.Size(24, 20)
Me.txc.TabIndex = 4
Me.txc.Text = ""
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(120, 112)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(24, 16)
Me.Label3.TabIndex = 5
Me.Label3.Text = "x"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(184, 112)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(24, 16)
Me.Label4.TabIndex = 6
Me.Label4.Text = "y1"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(247, 112)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(24, 16)
Me.Label5.TabIndex = 7
Me.Label5.Text = "z"
'
'txa1
'
Me.txa1.Location = New System.Drawing.Point(96, 163)
Me.txa1.Name = "txa1"
Me.txa1.Size = New System.Drawing.Size(24, 20)
Me.txa1.TabIndex = 8
Me.txa1.Text = ""
'
'txb1
'
Me.txb1.Location = New System.Drawing.Point(160, 163)
Me.txb1.Name = "txb1"
Me.txb1.Size = New System.Drawing.Size(24, 20)
Me.txb1.TabIndex = 9
Me.txb1.Text = ""
'
'txc1
'
Me.txc1.Location = New System.Drawing.Point(216, 163)
Me.txc1.Name = "txc1"
Me.txc1.Size = New System.Drawing.Size(24, 20)
Me.txc1.TabIndex = 10
Me.txc1.Text = ""
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(120, 168)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(24, 16)
Me.Label6.TabIndex = 11
Me.Label6.Text = "x"
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(184, 167)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(24, 16)
Me.Label7.TabIndex = 12
Me.Label7.Text = "y1"
'
'Label8
'
Me.Label8.Location = New System.Drawing.Point(243, 168)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(24, 16)
Me.Label8.TabIndex = 13
Me.Label8.Text = "z"
'
'Label9
'
Me.Label9.Location = New System.Drawing.Point(352, 112)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(16, 24)
Me.Label9.TabIndex = 14
Me.Label9.Text = "y"
'
'Label10
'
Me.Label10.Location = New System.Drawing.Point(352, 144)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(16, 24)
Me.Label10.TabIndex = 15
Me.Label10.Text = "z"
'
'txx
'
Me.txx.Location = New System.Drawing.Point(368, 112)
Me.txx.Name = "txx"
Me.txx.Size = New System.Drawing.Size(24, 20)
Me.txx.TabIndex = 16
Me.txx.Text = "(x)"
'
'txx1
'
Me.txx1.Location = New System.Drawing.Point(368, 144)
Me.txx1.Name = "txx1"
Me.txx1.Size = New System.Drawing.Size(24, 20)
Me.txx1.TabIndex = 17
Me.txx1.Text = "(x)"
'
'Label11
'
Me.Label11.Location = New System.Drawing.Point(352, 176)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(24, 16)
Me.Label11.TabIndex = 18
Me.Label11.Text = "h="
'
'Txh
'
Me.Txh.Location = New System.Drawing.Point(376, 169)
Me.Txh.Name = "Txh"
Me.Txh.Size = New System.Drawing.Size(32, 20)
Me.Txh.TabIndex = 19
Me.Txh.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(88, 280)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(48, 32)
Me.Button1.TabIndex = 20
Me.Button1.Text = "Button1"
'
'txy
'
Me.txy.Location = New System.Drawing.Point(424, 112)
Me.txy.Name = "txy"
Me.txy.Size = New System.Drawing.Size(24, 20)
Me.txy.TabIndex = 21
Me.txy.Text = ""
'
'txz
'
Me.txz.Location = New System.Drawing.Point(424, 144)
Me.txz.Name = "txz"
Me.txz.Size = New System.Drawing.Size(24, 20)
Me.txz.TabIndex = 22
Me.txz.Text = ""
'
'Label12
'
Me.Label12.Location = New System.Drawing.Point(208, 272)
Me.Label12.Name = "Label12"
Me.Label12.Size = New System.Drawing.Size(112, 32)
Me.Label12.TabIndex = 23
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(592, 350)
Me.Controls.Add(Me.Label12)
Me.Controls.Add(Me.txz)
Me.Controls.Add(Me.txy)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Txh)
Me.Controls.Add(Me.Label11)
Me.Controls.Add(Me.txx1)
Me.Controls.Add(Me.txx)
Me.Controls.Add(Me.Label10)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.txc1)
Me.Controls.Add(Me.txb1)
Me.Controls.Add(Me.txa1)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.txc)
Me.Controls.Add(Me.txb)
Me.Controls.Add(Me.txa)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, z, h, f1, f2, b, c, a, x1, y1, z1, c1, a1, b1 As Decimal


f1 = ((a * x) + (b * y) + (c * z))
f2 = x1 * a1 + z1 * c1 + y1 * b1
b = Val(txb.Text)
c = Val(txc.Text)
a = Val(txa.Text)
b1 = Val(txb1.Text)
c1 = Val(txc1.Text)
a1 = Val(txa1.Text)
x = Val(txx.Text)
y = Val(txy.text)
z = Val(txz.Text)
x1 = Val(txx.Text)
y1 = Val(txy.Text)
z1 = Val(txz.Text)

Label12.Text = f1

End Sub
End Class
  Alıntı Yaparak CevaplaAlıntı Yaparak Cevapla
Eski 12-05-04, 22:57 #2
haldunuraz haldunuraz çevrimdışı
Varsayılan Cvp: çok acil neden hep 0 veriyo sonucu (visual basic.NET)

f1 = ((a * x) + (b * y) + (c * z))
f2 = x1 * a1 + z1 * c1 + y1 * b1
bu satırı

b = Val(txb.Text)
c = Val(txc.Text)
a = Val(txa.Text)
b1 = Val(txb1.Text)
c1 = Val(txc1.Text)
a1 = Val(txa1.Text)
x = Val(txx.Text)
y = Val(txy.text)
z = Val(txz.Text)
x1 = Val(txx.Text)
y1 = Val(txy.Text)
z1 = Val(txz.Text)

bunların altına al

b = Val(txb.Text)
c = Val(txc.Text)
a = Val(txa.Text)
b1 = Val(txb1.Text)
c1 = Val(txc1.Text)
a1 = Val(txa1.Text)
x = Val(txx.Text)
y = Val(txy.text)
z = Val(txz.Text)
x1 = Val(txx.Text)
y1 = Val(txy.Text)
z1 = Val(txz.Text)
f1 = ((a * x) + (b * y) + (c * z))
f2 = x1 * a1 + z1 * c1 + y1 * b1

şeklinde
  Alıntı Yaparak CevaplaAlıntı Yaparak Cevapla
Eski 12-05-04, 23:37 #3
Sessiz_cin Sessiz_cin çevrimdışı
Varsayılan Cvp: çok acil neden hep 0 veriyo sonucu (visual basic.NET)

Değerleri girmeden değerlerle işlem yaptırmışsın iş ezbere yapılırsa çok normal
  Alıntı Yaparak CevaplaAlıntı Yaparak Cevapla
Eski 13-05-04, 17:58 #4
Xenonz Xenonz çevrimdışı
Varsayılan Cvp: çok acil neden hep 0 veriyo sonucu (visual basic.NET)

valla benden anca bu kadar bide bişey sorucaktım fonkiyon nasıl tanımlarız msl
f[x,y,z) aha bunun gibi bi fonksiyon bunu nasıl yaparız? kısa yoldan
  Alıntı Yaparak CevaplaAlıntı Yaparak Cevapla
Cevapla

Bu konunun kısa yolunu aşağıdaki sitelere ekleyebilirsiniz

Konu Araçları

Gönderme Kuralları
Yeni konu açamazsınız
Cevap yazamazsınız
Dosya gönderemezsiniz
Mesajlarınızı düzenleyemezsiniz

BB code is Açık
Smiley Açık
[IMG] kodu Açık
HTML kodu Kapalı



Tüm saatler GMT +3. Şuan saat: 08:48
(Türkiye için artık GMT +3 seçilmelidir.)

 
5651 sayılı yasaya göre forumumuzdaki mesajlardan doğabilecek her türlü sorumluluk yazan kullanıcılara aittir. Şikayet Mailimiz. İçerik, Yer Sağlayıcı Bilgilerimiz. Tatil