Girilen vize notları ve finallere göre ders ortalamasını ve harf notunu hesaplar,vizeleri,finalleri,ortalamayı ve harf notunu hafızasına kaydeder.Program üzerinde ders adlarını,vize ve final oranlarını değiştirip kaydedebilirsiniz.
Programın kodları
Bir çok konuda öğretici olabilir,örnek olarak dosya kayıt işlemleri v.s)
Programın kodları
Kod:
Dim v1 As Integer, v2 As Integer, fin As Integer, ort As Integer, h As String
Dim ders As String, or1 As String, or2 As String, or3 As String, ders2 As String
Dim orv1 As Double, orv2 As Double, orfin As Double
Dim cevap
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
Private Sub Command2_Click()
ders = InputBox("Değiştirmek istediğiniz dersin adını giriniz", "Ders değiştir")
If ders = "" Then
GoTo 10
End If
If Option1.Value Then
Option1.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr1ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option2.Value Then
Option2.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr2ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option3.Value Then
Option3.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr3ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option4.Value Then
Option4.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr4ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option5.Value Then
Option5.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr5ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option6.Value Then
Option6.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr6ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option7.Value Then
Option7.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr7ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option8.Value Then
Option8.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr8ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option9.Value Then
Option9.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr9ad.not" For Output As 1
Print #1, ders
Close
ElseIf Option10.Value Then
Option10.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr10ad.not" For Output As 1
Print #1, ders
Close
Else
Option11.Caption = ders
Label6.Caption = ders
Open "C:\Program Files\Not Hesabı\dr11ad.not" For Output As 1
Print #1, ders
Close
End If
10 End Sub
Private Sub Command3_Click()
Form2.Show
End Sub
Private Sub Command4_Click()
or1 = InputBox("1. vizenin % olarak oranını giriniz[ör: %40 ise 40]", "Oran Değiştir")
If or1 = "" Then
GoTo 10
End If
or2 = InputBox("2. vizenin % olarak oranını giriniz[ör: %40 ise 40]", "Oran Değiştir")
If or2 = "" Then
GoTo 10
End If
or3 = InputBox("Finalin % olarak oranını giriniz[ör: %40 ise 40]", "Oran Değiştir")
If or3 = "" Then
GoTo 10
End If
MsgBox "Oranlar Değiştirildi", vbInformation, "Oran Değiştir"
Open "C:\Program Files\Not Hesabı\or1.not" For Output As 1
Print #1, or1
Close
Open "C:\Program Files\Not Hesabı\or2.not" For Output As 1
Print #1, or2
Close
Open "C:\Program Files\Not Hesabı\or3.not" For Output As 1
Print #1, or3
Close
10 End Sub
Private Sub Command5_Click()
Form3.Show
End Sub
Private Sub Command7_Click()
cevap = MsgBox("Bütün dersler sıfırlansınmı?", vbYesNo + vbQuestion, "Sıfırla")
If cevap = 6 Then
Open "C:\Program Files\Not Hesabı\dr1.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr2.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr3.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr4.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr5.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr6.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr7.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr8.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr9.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr10.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
Open "C:\Program Files\Not Hesabı\dr11.not" For Output As 1
Print #1, 0, 0, 0, 0, "FF"
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = "FF"
Close
MsgBox "Bütün dersler sıfırlandı", vbInformation, "Sıfırla"
Else
End If
End Sub
Private Sub Form_Initialize()
InitCommonControls
Open "C:\Program Files\Not Hesabı\dr1ad.not" For Input As 1
Input #1, ders
Option1.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr2ad.not" For Input As 1
Input #1, ders
Option2.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr3ad.not" For Input As 1
Input #1, ders
Option3.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr4ad.not" For Input As 1
Input #1, ders
Option4.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr5ad.not" For Input As 1
Input #1, ders
Option5.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr6ad.not" For Input As 1
Input #1, ders
Option6.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr7ad.not" For Input As 1
Input #1, ders
Option7.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr8ad.not" For Input As 1
Input #1, ders
Option8.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr9ad.not" For Input As 1
Input #1, ders
Option9.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr10ad.not" For Input As 1
Input #1, ders
Option10.Caption = ders
Close
Open "C:\Program Files\Not Hesabı\dr11ad.not" For Input As 1
Input #1, ders
Option11.Caption = ders
Close
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
End Sub
Private Sub Command1_Click()
Open "C:\Program Files\Not Hesabı\or1.not" For Input As 1
Input #1, or1
Close
Open "C:\Program Files\Not Hesabı\or2.not" For Input As 1
Input #1, or2
Close
Open "C:\Program Files\Not Hesabı\or3.not" For Input As 1
Input #1, or3
Close
If or1 = 10 Then
orv1 = 0.1
ElseIf or1 = 20 Then
orv1 = 0.2
ElseIf or1 = 30 Then
orv1 = 0.3
ElseIf or1 = 40 Then
orv1 = 0.4
ElseIf or1 = 50 Then
orv1 = 0.5
End If
If or2 = 0 Then
orv2 = 0
ElseIf or2 = 10 Then
orv2 = 0.1
ElseIf or2 = 20 Then
orv2 = 0.2
ElseIf or2 = 30 Then
orv2 = 0.3
ElseIf or2 = 40 Then
orv2 = 0.4
ElseIf or2 = 50 Then
orv2 = 0.5
End If
If or3 = 40 Then
orfin = 0.4
ElseIf or3 = 50 Then
orfin = 0.5
ElseIf or3 = 60 Then
orfin = 0.6
ElseIf or3 = 70 Then
orfin = 0.7
End If
v1 = Text1.Text
v2 = Text2.Text
fin = Text3.Text
ort = (v1 * orv1) + (v2 * orv2) + (fin * orfin)
Text4.Text = ort
If Text4 >= 80 Then
Text5.Text = "AA"
ElseIf Text4 >= 75 Then
Text5.Text = "BA"
ElseIf Text4 >= 70 Then
Text5.Text = "BB"
ElseIf Text4 >= 60 Then
Text5.Text = "CB"
ElseIf Text4 >= 50 Then
Text5.Text = "CC"
ElseIf Text4 >= 45 Then
Text5.Text = "DC"
ElseIf Text4 >= 40 Then
Text5.Text = "DD"
ElseIf Text4 >= 30 Then
Text5.Text = "FD"
Else
Text5.Text = "FF"
End If
h = Text5.Text
If Option1.Value Then
Open "C:\Program Files\Not Hesabı\dr1.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option2.Value Then
Open "C:\Program Files\Not Hesabı\dr2.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option3.Value Then
Open "C:\Program Files\Not Hesabı\dr3.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option4.Value Then
Open "C:\Program Files\Not Hesabı\dr4.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option5.Value Then
Open "C:\Program Files\Not Hesabı\dr5.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option6.Value Then
Open "C:\Program Files\Not Hesabı\dr6.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option7.Value Then
Open "C:\Program Files\Not Hesabı\dr7.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option8.Value Then
Open "C:\Program Files\Not Hesabı\dr8.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option9.Value Then
Open "C:\Program Files\Not Hesabı\dr9.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option10.Value Then
Open "C:\Program Files\Not Hesabı\dr10.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
ElseIf Option11.Value Then
Open "C:\Program Files\Not Hesabı\dr11.not" For Output As 1
Print #1, v1, v2, fin, ort, h
Close
End If
End Sub
Private Sub Option1_Click()
Open "C:\Program Files\Not Hesabı\dr1.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option1.Caption
Label6.Caption = ders2
End Sub
Private Sub Option10_Click()
Open "C:\Program Files\Not Hesabı\dr10.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option10.Caption
Label6.Caption = ders2
End Sub
Private Sub Option11_Click()
Open "C:\Program Files\Not Hesabı\dr11.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option11.Caption
Label6.Caption = ders2
End Sub
Private Sub Option2_Click()
Open "C:\Program Files\Not Hesabı\dr2.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option2.Caption
Label6.Caption = ders2
End Sub
Private Sub Option3_Click()
Open "C:\Program Files\Not Hesabı\dr3.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option3.Caption
Label6.Caption = ders2
End Sub
Private Sub Option4_Click()
Open "C:\Program Files\Not Hesabı\dr4.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option4.Caption
Label6.Caption = ders2
End Sub
Private Sub Option5_Click()
Open "C:\Program Files\Not Hesabı\dr5.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option5.Caption
Label6.Caption = ders2
End Sub
Private Sub Option6_Click()
Open "C:\Program Files\Not Hesabı\dr6.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option6.Caption
Label6.Caption = ders2
End Sub
Private Sub Option7_Click()
Open "C:\Program Files\Not Hesabı\dr7.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option7.Caption
Label6.Caption = ders2
End Sub
Private Sub Option8_Click()
Open "C:\Program Files\Not Hesabı\dr8.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option8.Caption
Label6.Caption = ders2
End Sub
Private Sub Option9_Click()
Open "C:\Program Files\Not Hesabı\dr9.not" For Input As 1
Input #1, v1, v2, fin, ort, h
Close
Text1.Text = v1
Text2.Text = v2
Text3.Text = fin
Text4.Text = ort
Text5.Text = h
ders2 = Option9.Caption
Label6.Caption = ders2
End Sub

