- Information
- AI Chat
Was this document helpful?
Sample Q4 Solution programming 1a assignmnent
Course: Programming
119 Documents
Students shared 119 documents in this course
University: Damelin
Was this document helpful?
Public Class Form1
Dim count As Integer = 0
Dim Marks(3) As Integer
'function that find the highest marks from the give three marks
Function FindHighestMark(ByVal m_1 As Integer, ByVal m_2 As Integer, ByVal m_3 As Integer)
If m_1 > m_2 Then
If m_1 > m_3 Then
Return m_1
Else
Return m_3
End If
ElseIf m_2 > m_3 Then
Return m_2
Else
Return m_3
End If
End Function
'function that calculate average marks start here
Function CalcAverage(ByVal m_1 As Integer, ByVal m_2 As Integer, ByVal m_3 As Integer)
Return (m_1 + m_2 + m_3) / 3
End Function
'funtion that categorises the marks
Function Category(ByVal m As Integer)
If m >= 75 Then
Return "Passed with Distinction"