Merhaba Arkadaşlar,
Bu teknik yazıda, Asp.net platformunda VB programlama dilini kullanarak YGS puan hesaplama sayfası tasarlayacağız.
Microsoft Web Develepover(Veya Microsoft Studio) Programı üzerinden Empty(boş) bir Asp sayfası açıyoruz.Daha sonra yukarıdaki resimdeki gibi bir sayfa tasarım oluşturuyoruz.Bu sayfada 18 Adet Textbox, 12 Adet Buton, 6 Adette labelimiz olacak.Textboxların id’leri örneğin tur1(Türkçe doğru sayısı için), tur2(Türkçe yanlış sayısı için), tur3(Türkçe Net Sayısı İçin), Diğerleri de aynı doğrultu da “mat1, mat2, mat3, sos1, sos2 ,sos3, fen1, fen2 ,fen3”, Puan Bölümleri için ; “ygs1, ygs2….”, Butonlar için;”ygsa, ygsb, ygsc ,…”, Labelerin sadece Text:”siliyoruz.” id’leri defaultaki gibi kalıyor. Bunları hallettikten sonra Kodlama Bölümüne Geçebiliriz.
Kodlama Bölümü <script></script>
Türkçe Butonu
Protected Sub turk_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim son1 As Double
son1 = turk1.Text – (turk2.Text / 4)
turk3.Text = son1
End Sub
Matematik Butonu
Protected Sub mat_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim son2 As Double
son2 = mat1.Text – (mat2.Text / 4)
mat3.Text = son2
End Sub
Sosyal Bilimler Butonu
Protected Sub sos_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim son3 As Double
son3 = sos1.Text – (sos2.Text / 4)
sos3.Text = son3
End Sub
Fen Bilimleri Butonu
Protected Sub fen_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim son4 As Double
son4 = fen1.Text – (fen2.Text / 4)
fen3.Text = son4
End Sub
Temizle Butonu
Protected Sub sil_Click(ByVal sender As Object, ByVal e As System.EventArgs)
turk1.Text = “”
turk2.Text = “”
turk3.Text = “”
mat1.Text = “”
mat2.Text = “”
mat3.Text = “”
sos1.Text = “”
sos2.Text = “”
sos3.Text = “”
fen1.Text = “”
fen2.Text = “”
fen3.Text = “”
ygs1.Text = “”
ygs2.Text = “”
ygs3.Text = “”
ygs4.Text = “”
ygs5.Text = “”
ygs6.Text = “”
Label1.Text = “”
Label2.Text = “”
Label3.Text = “”
Label4.Text = “”
Label5.Text = “”
Label6.Text = “”
End Sub
Hedef Ata Butonu
Protected Sub hed_Click(ByVal sender As Object, ByVal e As System.EventArgs)
turk1.Text = “36”
turk2.Text = “2”
turk3.Text = “35,5”
mat1.Text = “28”
mat2.Text = “6”
mat3.Text = “25,5”
sos1.Text = “33”
sos2.Text = “6”
sos3.Text = “30,5”
fen1.Text = “23”
fen2.Text = “6”
fen3.Text = “20,5”
ygs1.Text = “”
ygs2.Text = “”
ygs3.Text = “”
ygs4.Text = “”
ygs5.Text = “”
ygs6.Text = “”
End Sub
Ygs1 ButonuProtected Sub ygsa_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 1.9990000000000001
matematik = mat3.Text * 3.9980000000000002
sosyal = sos3.Text * 1.0
fenb = fen3.Text * 2.9990000000000001
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs1.Text = ygs1s
If ygs1.Text >= 450 Then
Label1.Text = “Sakarya Üniv. Teknoloji Fakültesi”
ElseIf ygs1.Text >= 400 Then
Label1.Text = “Boğaziçi Üniversitesi Böte”
ElseIf ygs1.Text >= 350 Then
Label1.Text = “Gazi Üniversitesi Bötö”
Else
Label1.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Ygs2 ButonuProtected Sub ygsb_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 1.9990000000000001
matematik = mat3.Text * 2.9980000000000002
sosyal = sos3.Text * 1.0
fenb = fen3.Text * 3.9990000000000001
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs2.Text = ygs1s
If ygs1.Text >= 450 Then
Label2.Text = “Sakarya Üniversitesi”
ElseIf ygs2.Text >= 400 Then
Label2.Text = “Boğaziçi Üniversitesi “
ElseIf ygs2.Text >= 350 Then
Label2.Text = “Gazi Üniversitesi”
Else
Label2.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Ygs3 ButonuProtected Sub ygsc_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 3.9990000000000001
matematik = mat3.Text * 1.9980000000000002
sosyal = sos3.Text * 2.9998999999999998
fenb = fen3.Text * 1.0
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs3.Text = ygs1s
If ygs3.Text >= 450 Then
Label3.Text = “Sakarya Üniversitesi”
ElseIf ygs3.Text >= 400 Then
Label3.Text = “Boğaziçi Üniversitesi “
ElseIf ygs3.Text >= 350 Then
Label3.Text = “Gazi Üniversitesi”
Else
Label3.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Ygs4 ButonuProtected Sub ygsd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 2.9990000000000001
matematik = mat3.Text * 1.9980000000000002
sosyal = sos3.Text * 3.9998999999999998
fenb = fen3.Text * 1.0
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs4.Text = ygs1s
If ygs4.Text >= 450 Then
Label4.Text = “Sakarya Üniversitesi”
ElseIf ygs4.Text >= 400 Then
Label4.Text = “Boğaziçi Üniversitesi “
ElseIf ygs4.Text >= 350 Then
Label4.Text = “Gazi Üniversitesi”
Else
Label4.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Ygs5 ButonuProtected Sub ygse_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 3.669
matematik = mat3.Text * 3.2989999999999999
sosyal = sos3.Text * 2.9998999999999998
fenb = fen3.Text * 1.0
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs5.Text = ygs1s
If ygs5.Text >= 450 Then
Label5.Text = “Sakarya Üniversitesi”
ElseIf ygs5.Text >= 400 Then
Label5.Text = “Boğaziçi Üniversitesi “
ElseIf ygs5.Text >= 350 Then
Label5.Text = “Gazi Üniversitesi”
Else
Label5.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Ygs6 ButonuProtected Sub ygsf_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim turkce As Double
Dim matematik As Double
Dim sosyal As Double
Dim fenb As Double
Dim ygs1s As Double
turkce = turk3.Text * 3.2989999999999999
matematik = mat3.Text * 3.6989999999999998
sosyal = sos3.Text * 2.9998999999999998
fenb = fen3.Text * 1.0
ygs1s = turkce + matematik + sosyal + fenb + 100
ygs6.Text = ygs1s
If ygs6.Text >= 450 Then
Label6.Text = “Sakarya Üniversitesi”
ElseIf ygs6.Text >= 400 Then
Label6.Text = “Boğaziçi Üniversitesi “
ElseIf ygs6.Text >= 350 Then
Label6.Text = “Gazi Üniversitesi”
Else
Label6.Text = “Üniversiteye Girme İhtimali Düşük”
End If
End Sub
Kodlama Bölümü Biter.<script></script>Eğer bir sorun yaşamadıysanız, Sayfa Görünümü Şu Şekil Olacaktı.
İlk Asp.Net Teknik Yazımın Sonuna Gelmiş Bulunmaktayız. Başka Bir Asp.Net Yazısında Görüşmek Üzere….
ibrahim AYHAN