Welcome, Visitor!

Hello, we are really happy that you have reached us. However, since you are viewing the forum as a visitor, you cannot benefit from many features of the forum. How about taking advantage of all the features exclusive to our members by registering? You can register right now, taking just 2 minutes of your time. We would love to see you among us.

Visual Basic Listbox İle Öğrenci Notu Hesaplama

H

HZ.CİN

Cin Terbiyecisi
Thread Starter
Ultra Member
Joined
Dec 22, 2019
Messages
387
Reaction score
71
Location
Cehennem
Bu örneğimizde bir üniversitede öğrenim gören öğrencilerin ad soyad numara bilgilerini ve giriş tarihini alarak hangi fakültede okuduğunu bulan ve girilen vize ve final notuna göre ortalamasını hesaplayarak sonucu hem rakam hemde harf olarak bulan ve bunları ayrı ayrı listbox nesnelerinde gösteren visual basic programını yapacağız.


Öğrenci numarasına göre öğrencinin fakültesi belirleniyor. Öğrenci numarasının 3. ve 4. dördüncü rakamına göre fakültesi tespit ediliyor. Öğrencinin vize notunun %40’ı ve final notunun %60’ı alınarak ortalaması hesaplanıyor.


Bulunan ortalamaya göre bu rakama karşılık gelen harf karşılığı bulunuyor. Daha sonra tüm bilgiler ayrı ayrı listboxlara ekleniyor.


Code:
[/
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      
        Dim Notu As Integer
        Dim Yil As String
        Dim Fak, numara As String
        Yil = Now.Date.Year.ToString

        'Eğer giriş yılının son iki hanesi 50’den küçükse 2000’li yıllar
        'olduğunu anla ve başına 20 ekle. Aksi halde başına 19 ekle:

        ListBox1.Items.Add(Yil)
      
        numara = TextBox1.Text
        Fak = Strings.Mid(numara, 3, 2)
        If Fak = "01" Then
            ListBox2.Items.Add("Mühendislik")
        ElseIf Fak = "02" Then
            ListBox2.Items.Add("Eğitim Bil.")
        ElseIf Fak = "03" Then
            ListBox2.Items.Add("Hukuk")
        ElseIf Fak = "04" Then
            ListBox2.Items.Add("iletişim")
        Else
            ListBox2.Items.Add("Diğerleri")
        End If

        ListBox3.Items.Add(TextBox2.Text + " " + TextBox3.Text)
        Notu = (TextBox4.Text * 0.4) + (TextBox5.Text * 0.6)
        ListBox4.Items.Add(Notu)
        If Notu <= 100 And Notu > 89 Then
            ListBox5.Items.Add("AA")
        ElseIf Notu > 84 Then
            ListBox5.Items.Add("BA")
        ElseIf Notu > 79 Then
            ListBox5.Items.Add("BB")
        ElseIf Notu > 74 Then
            ListBox5.Items.Add("CB")
        ElseIf Notu > 69 Then
            ListBox5.Items.Add("CC")
        ElseIf Notu > 64 Then
            ListBox5.Items.Add("DC")
        ElseIf Notu > 59 Then
            ListBox5.Items.Add("DD")
        ElseIf Notu > 49 Then
            ListBox5.Items.Add("FD")
        ElseIf Notu < 50 Then
            ListBox5.Items.Add("FF")
        End If

        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox1.Focus()

    End Sub
End Class
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Theme editor

Top Bottom