Project Calculation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

LIBRARY PROCESSING SYSTEM

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click
Dim submission As DateTime = DateTimePicker3.Value
Dim d1 As DateTime = DateTime.Parse(returndate.Text).Date
Dim d2 As DateTime = DateTime.Parse(submission).Date
Dim days As Single = (d2 - d1).TotalDays
If days <= 0 Then
txtpenalty.Text = 0
ElseIf days > 0 And days <= 10 Then
txtpenalty.Text = 50
Else
txtpenalty.Text = 100
End If
End Sub

Private Sub DateTimePicker1_CloseUp(sender As Object, e As EventArgs)


Handles DateTimePicker1.CloseUp
issuedate.Text = DateTimePicker1.Value.ToString("dd MMM yyyy")
End Sub

Private Sub DateTimePicker3_CloseUp(sender As Object, e As EventArgs)


Handles DateTimePicker3.CloseUp
submissiondate.Text = DateTimePicker3.Value.ToString("dd MMM yyyy")
End Sub

Private Sub returndate_Click(sender As Object, e As EventArgs) Handles


returndate.Click
returndate.Text = DateTimePicker1.Value.AddDays(10).ToString("dd MMM
yyyy")
End Sub
End Class
MARKSHEET PROCESSING SYSTEM

Public Class Form1

Private Sub total_GotFocus(sender As Object, e As EventArgs) Handles


total.GotFocus
total.Text = Val(txtrdbms.Text) + Val(txtcn.Text) + Val(txtgraphics.Text) +
Val(txtos.Text)

End Sub

Private Sub percentage_GotFocus(sender As Object, e As EventArgs) Handles


percentage.GotFocus
percentage.Text = total.Text / 4
End Sub

Private Sub result_GotFocus(sender As Object, e As EventArgs) Handles


result.GotFocus
If txtcn.Text >= 30 And txtgraphics.Text >= 30 And txtos.Text >= 30 And
txtrdbms.Text >= 30 Then
result.Text = "PASS"
Else
result.Text = "FAIL"
End If
End Sub

Private Sub clear_Click(sender As Object, e As EventArgs) Handles clear.Click


txtcn.Text = ""
txtgraphics.Text = ""
txtos.Text = ""
txtrdbms.Text = ""
result.Text = ""
percentage.Text = ""
grade.Text = ""
total.Text = ""
End Sub

Private Sub grade_GotFocus(sender As Object, e As EventArgs) Handles


grade.GotFocus
If percentage.Text >= 75 Then
grade.Text = "I CLASS WITH DISTINCTION"
ElseIf percentage.Text > 60 And percentage.Text < 75 Then
grade.Text = "I CLASS "
End If
End Sub

You might also like