0% found this document useful (0 votes)
15 views1 page

Subject Grade

The document is a Visual Basic program that prompts users to input their marks for five subjects: Physics, Chemistry, Biology, Mathematics, and Computer. It calculates the total marks, percentage, and assigns a grade based on the percentage using a grading scale. Finally, it displays the calculated percentage and corresponding grade to the user.

Uploaded by

Sameer Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Subject Grade

The document is a Visual Basic program that prompts users to input their marks for five subjects: Physics, Chemistry, Biology, Mathematics, and Computer. It calculates the total marks, percentage, and assigns a grade based on the percentage using a grading scale. Finally, it displays the calculated percentage and corresponding grade to the user.

Uploaded by

Sameer Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Module Module1

Sub Main()
' Declare variables to store the marks for each subject and total marks
Dim physics, chemistry, biology, mathematics, computer As Integer
Dim totalMarks As Integer
Dim percentage As Double
Dim grade As String

' Prompt the user to enter the marks for each subject
Console.WriteLine("Enter marks for Physics: ")
physics = Convert.ToInt32(Console.ReadLine())

Console.WriteLine("Enter marks for Chemistry: ")


chemistry = Convert.ToInt32(Console.ReadLine())

Console.WriteLine("Enter marks for Biology: ")


biology = Convert.ToInt32(Console.ReadLine())

Console.WriteLine("Enter marks for Mathematics: ")


mathematics = Convert.ToInt32(Console.ReadLine())

Console.WriteLine("Enter marks for Computer: ")


computer = Convert.ToInt32(Console.ReadLine())

' Calculate total marks


totalMarks = physics + chemistry + biology + mathematics + computer

' Calculate percentage


percentage = (totalMarks / 500.0) * 100.0

' Determine the grade based on the percentage


Select Case percentage
Case Is >= 90
grade = "A"
Case Is >= 80
grade = "B"
Case Is >= 70
grade = "C"
Case Is >= 60
grade = "D"
Case Else
grade = "F"
End Select

' Display the percentage and grade


Console.WriteLine("Percentage: " & percentage & "%")
Console.WriteLine("Grade: " & grade)
End Sub

End Module

You might also like