VB Not Hesaplama

visual basic 6Evet arkadaşlar şimdide sizlere Visual Basic’te Not Hesaplamayı Göstericez. Kendimden örnek vericem bunun için.
2 tane vize ve bir tane final notunu giricez, program bizim ortalamamızı hesaplıyacak ve geçip geçmediğimizi (50 üzerinden) söyleyecek.  5 tane text nesnesi, 1 tanede buton nesnesi oluşturmamız gerekiyor. Aşağıdaki komutları da
buton nesnesine çift tıklayıp içine yazarak çalıştırabiliyoruz.
***************************
***************************
Private Sub Command1_Click()
Dim vize1 As Integer
Dim vize2 As Integer
Dim final As Integer
Dim note As Double
Dim viz1 As Double
Dim viz2 As Double
Dim fin As Double
vize1 = Val(Text1.Text)
vize2 = Val(Text2.Text)
final = Val(Text3.Text)
If vize1 < 0 Or vize1 > 100 Then
MsgBox (“1.vize notunu yanlış girdiniz”)
Else
viz1 = (vize1 * 30) / 100
End If
If vize2 < 0 Or vize2 > 100 Then
MsgBox (“2.vize notunu yanlış girdiniz”)
Else
viz2 = (vize2 * 30) / 100
End If
If final < 0 Or final > 100 Then
MsgBox (“Final notunu yanlış girdiniz”)
Else
fin = (final * 40) / 100
End If
note = (viz1 + viz2 + fin)
Text4.Text = note
If note < 50 Then
Text5.Text = “KALDI”
Else
Text5.Text = “GEÇTİ”
msgbox(“___Ertan  Donmez___Trakya Üniversitesi___”)
End If
End Sub

Cevap Gönder

E-posta adresiniz yorumunuzda yayınlanmayacaktır.