ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

VB.Net program to find the division of a student based on a given percentage

Here, we are going to learn how to find the division of a student based on a given percentage in VB.Net?
Submitted by Nidhi, on December 03, 2020

Here, we will read the percentage of a student from the user and then print the division of students using the if statement on the console screen.

Program/Source Code:

The source code to find out the division of students based on the given percentage is given below. The given program is compiled and executed successfully.

'VB.Net program to find out the division 
'based on percentage.

Module Module1

    Sub Main()
        Dim percentage As Double = 0

        Console.Write("Enter percentage: ")
        percentage = Double.Parse(Console.ReadLine())

        If percentage > 60 Then
            Console.WriteLine("First division")
        ElseIf percentage > 45 Then
            Console.WriteLine("Second division")
        ElseIf percentage > 33 Then
            Console.WriteLine("Third division")
        Else
            Console.WriteLine("You are failed")
        End If
    End Sub
    
End Module

Output:

Enter percentage: 56
Second division
Press any key to continue . . .

Explanation:

In the above program, we created a module Module1 that contains a method Main(). In the Main() method, we created a variable percentage with an initial value of 0.

Console.Write("Enter percentage: ")
percentage = Double.Parse(Console.ReadLine())

In the above code, we read the value of variable percentage from user.

If percentage > 60 Then
    Console.WriteLine("First division")
ElseIf percentage > 45 Then
    Console.WriteLine("Second division")
ElseIf percentage > 33 Then
    Console.WriteLine("Third division")
Else
    Console.WriteLine("You are failed")
End If

In the above code, we find the division of students based on a given percentage and print the division on the console screen.

VB.Net Basic Programs »



ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.