Program to calculate Gross Salary with DA and HRA in VB.net
#percentage #vbnet #consoleapplication
the source code is here
(replace lessthan and greaterthan with its symbol)
Module Condional
Sub main()
Dim phy, che, bio, maths, cmp, tot, per As Single
Console.Write("Please input marks:")
Console.WriteLine("Physics: ")
phy = Console.ReadLine()
Console.WriteLine("Chemistry: ")
che = Console.ReadLine()
Console.WriteLine("Biology: ")
bio = Console.ReadLine()
Console.WriteLine("Maths: ")
maths = Console.ReadLine()
Console.WriteLine("Computer: ")
cmp = Console.ReadLine()
tot = phy + che + bio + maths + cmp
per = tot / 5
If (per lessthan 40) Then
Console.Write("Fail")
ElseIf (per greaterthan= 40 And per lessthan 60) Then
Console.Write("Grade E")
ElseIf (per greaterthan= 60 And per lessthan 70) Then
Console.Write("Grade D")
ElseIf (per greaterthan= 70 And per lessthan 80) Then
Console.Write("Grade C")
ElseIf (per greaterthan= 80 And per lessthan 90) Then
Console.Write("Grade B")
ElseIf (per greaterthan= 90 And per lessthan = 100) Then
Console.Write("Grade A")
Else
Console.Write("Input invalid")
End If
Console.WriteLine("Your percentage is {0}", per)
Console.ReadKey()
End Sub
End Module