Module Module1 Sub Main() Dim firstName As String Dim lastName As String Dim pointsReceived As Decimal Dim scorePercentage As Decimal Dim finalGrade As String Console.WriteLine("Welcome to the Stundent Grade Calculator. This program will calculate students score percentage and grade score.") Console.WriteLine("Please Enter students first name:") firstName = Console.ReadLine() Console.WriteLine("Please enter students last name:") lastName = Console.ReadLine() Console.WriteLine("Please enter students points received:") pointsReceived = Console.ReadLine() If pointsReceived >= 0 And pointsReceived <= 1000 Then Console.WriteLine("Good Score") Else Console.WriteLine("Error") End If scorePercentage = (pointsReceived / 1000) * 100 If scorePercentage >= 0 And scorePercentage <= 59 Then finalGrade = "F" If scorePercentage >= 60 And scorePercentage <= 69 Then finalGrade = "D" If scorePercentage >= 70 And scorePercentage <= 79 Then finalGrade = "C" If scorePercentage >= 80 And scorePercentage <= 89 Then finalGrade = "B" If scorePercentage >= 90 And scorePercentage <= 100 Then finalGrade = "A" Else Console.WriteLine("Error") End If End If End If End If End If Console.WriteLine("Student first name: " & firstName) Console.WriteLine("Students last name: " & lastName) Console.WriteLine("Students points: " & pointsReceived) Console.WriteLine("Calculated Percentage: %" & scorePercentage) Console.WriteLine("Final Grade: " & finalGrade)*/Problem is finalGrade Console.ReadLine() End Sub End Module
Dim firstName As String ="" Dim lastName As String ="" Dim pointsReceived As Decimal = 0 Dim scorePercentage As Decimal = 0 Dim finalGrade As String = "" ' this variable is not initialized with a value
Dim finalGrade As String = Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)