Write a Visual Basic program that will calculate the assessment marks of a student taking the Computer Programming subject in College. The program must be able to determine the total result and finally display the grade of that student. The program will also ensure that each mark entered must be within the range of 0 – 100.Each student will be assessed with 3 Assignments (70%) & 1 Final exam (30%)

asgmt1 15%,asgmt2 25%,asgmt3 30%,final exam 30%

Home work

Sure! Here's a step-by-step guide to writing a Visual Basic program that calculates assessment marks and displays the grade:

Step 1: Create a new Windows Forms application in Visual Basic.

Step 2: Add the necessary controls to the form. You'll need:
- Three TextBox controls for entering assignment marks (asgmt1, asgmt2, and asgmt3).
- One TextBox control for entering the final exam mark (finalExam).
- One Button control to calculate the result and display the grade.
- One Label control to display the grade.

Step 3: Set the properties of the controls:
- Set the Name property of each TextBox control accordingly (e.g., asgmt1, asgmt2, asgmt3, finalExam).
- Set the Text property of the Button control to "Calculate".
- Set the Name property of the Label control to "gradeLabel".
- Set the Text property of the Label control to an empty string.

Step 4: Double-click the Button control to create its click event handler.

Step 5: In the click event handler, write the code to calculate the total result and determine the grade:
```vb
Private Sub calculateButton_Click(sender As Object, e As EventArgs) Handles calculateButton.Click
' Parse the input values into numerical variables
Dim asgmt1Mark As Integer = Integer.Parse(asgmt1.Text)
Dim asgmt2Mark As Integer = Integer.Parse(asgmt2.Text)
Dim asgmt3Mark As Integer = Integer.Parse(asgmt3.Text)
Dim finalExamMark As Integer = Integer.Parse(finalExam.Text)

' Check if the marks are in the valid range (0 - 100)
If asgmt1Mark < 0 Or asgmt1Mark > 100 Or
asgmt2Mark < 0 Or asgmt2Mark > 100 Or
asgmt3Mark < 0 Or asgmt3Mark > 100 Or
finalExamMark < 0 Or finalExamMark > 100 Then
MessageBox.Show("Please enter marks between 0 and 100.")
Exit Sub
End If

' Calculate the total result
Dim totalResult As Integer = (asgmt1Mark * 15 / 100) +
(asgmt2Mark * 25 / 100) +
(asgmt3Mark * 30 / 100) +
(finalExamMark * 30 / 100)

' Determine the grade
Dim grade As String
If totalResult >= 90 Then
grade = "A"
ElseIf totalResult >= 80 Then
grade = "B"
ElseIf totalResult >= 70 Then
grade = "C"
ElseIf totalResult >= 60 Then
grade = "D"
Else
grade = "F"
End If

' Display the grade
gradeLabel.Text = grade
End Sub
```

Step 6: Build and run the program. Enter the assignment and exam marks, and then click the "Calculate" button. The grade will be displayed in the Label control.

That's it! You've now created a Visual Basic program that calculates assessment marks and displays the grade.

Certainly! Here's a possible solution in Visual Basic.

```vb
Module Module1
Sub Main()
Dim asgmt1, asgmt2, asgmt3, finalExam, totalMarks, finalGrade As Integer

'Get the marks for each assignment and the final exam
Console.WriteLine("Please enter the marks for Assignment 1 (out of 100):")
asgmt1 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine("Please enter the marks for Assignment 2 (out of 100):")
asgmt2 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine("Please enter the marks for Assignment 3 (out of 100):")
asgmt3 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine("Please enter the marks for the Final Exam (out of 100):")
finalExam = Convert.ToInt32(Console.ReadLine())

'Calculate the total marks
totalMarks = (asgmt1 * 0.15) + (asgmt2 * 0.25) + (asgmt3 * 0.3) + (finalExam * 0.3)

'Make sure the total marks are within the range of 0-100
If totalMarks < 0 Then
totalMarks = 0
ElseIf totalMarks > 100 Then
totalMarks = 100
End If

'Determine the final grade based on the total marks
If totalMarks >= 90 Then
finalGrade = "A"
ElseIf totalMarks >= 80 Then
finalGrade = "B"
ElseIf totalMarks >= 70 Then
finalGrade = "C"
ElseIf totalMarks >= 60 Then
finalGrade = "D"
Else
finalGrade = "F"
End If

'Display the final grade
Console.WriteLine("The student's final grade is: " & finalGrade)
Console.ReadLine()
End Sub
End Module
```

In this program, we first declare variables to store the marks for each assignment (`asgmt1`, `asgmt2`, `asgmt3`), the final exam (`finalExam`), the total marks (`totalMarks`), and the final grade (`finalGrade`).

We then prompt the user to enter the marks for each assignment and the final exam using `Console.WriteLine` and `Console.ReadLine`. The `Convert.ToInt32` method is used to convert the user input from string to integer.

Next, we calculate the total marks by multiplying each assignment mark by its weightage (15%, 25%, 30%) and the final exam mark by its weightage (30%), and summing them up.

We then ensure that the total marks are within the range of 0-100 using an `If` statement. If the total marks are less than 0, we set it to 0. If the total marks are greater than 100, we set it to 100.

Finally, we determine the final grade based on the total marks using another `If` statement. If the total marks are 90 or above, the final grade is "A". If the total marks are between 80 and 89, the final grade is "B", and so on. If the total marks are below 60, the final grade is "F".

We display the final grade to the user using `Console.WriteLine` and `Console.ReadLine`.

thambi