Creating student grading programs in VB.NET

I need to develope a program that assigns a letter grade (A for 90 or above, B for 80 to 89, C for 70 to 79, D for 60 to 69, F for 0 to 59) to studen't assignments based on a test score and other factors.  I will use a numeric up down control for test score input, a number of radio button controls to determine the final grade based on extra credit on a project.  The radio button value will be 0 for no extra credit, 3 points for an average grade on the extra credit project, and 5 points for an above average score on the extra credit project.  I will also be using radio buttons to subtract points for assingments not turned in on time.  I will subtract 5 points for assignments turned in 1 to 2 days late.  If an assignment is turned in more than 2 days late, an automatic final score of 0 will be given.  The default must be "On Time"
The final grade will be displayed in a read-only text box.

The user interface is already designed.

Here is the code that I have so far and it is giving me fits...please help fast!!


Dim NumericUpDown1_value = NumericUpDown1_value

Select Case FINALGRADE

 Case 0 FINALGRADE = "A >=90"
 Case 1 FINALGRADE = "B = 80..89"
 Case 2 FINALGRADE = "C = 70..79"
 Case 3 FINALGRADE = "D = 60..69"
 Case 4 FINALGRADE = "F = 0..59"

End Select

End Sub Private Sub

GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WOrkLateGroupBox2.Enter

End Sub

 Private Sub CalulateButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalulateButton1.Click

Dim FINALGRADE As Integer FINALGRADE = NumericUpDown1.Value
Dim HumericUpDown1 As Double If (NoneRadioButton1.Checked) Then

GradeTextBox1.Text = "FINALGRADE"

End If

 If (AverageRadioButton2.Checked) Then GradeTextBox1.Text = "FINALGRADE + 3"

End If

If (AboveAverageRadioButton3.Checked) Then GradeTextBox1.Text = "FINALGRADE+ 5"

End If

If (OnTimeRadioButton4.Checked) Then GradeTextBox1.Text = "FINALGRADE"

End If

If (OneDayLateRadioButton5.Checked) Then GradeTextBox1.Text = "FINALGRADE - 5" End If
 If (TwoDaysLateRadioButton6.Checked) Then GradeTextBox1.Text = "FINALGRADE = 0" End If

End Sub

I am very new to this and appreciate all the help I can get
howardnealAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

razorback041Commented:
from the top, i will try to catch as much as i see in a short time

your case statement

select case FinalGrade
    case 90 to 100
        LetterGrade = "A"
    case 80 to 89
        LetterGrade = "B"

you can't mix strings and integers, so you need two different variables above FinalGrade and LetterGrade or whatever...

however, this needs to be the last thing that is run before displaying the grades, as you need to evaluate the letter AFTER all the calculations (just making sure, I am sure you already had that)

in your if statements
i.e.
If (AboveAverageRadioButton3.Checked) Then GradeTextBox1.Text =  FINALGRADE+ 5   = remove the "'s for addition  " denotes a string

HTH get you going

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joe_GriffithCommented:
' First calculate the numeric grade and then convert it to a letter

Dim Grade As Double
Dim LetterGrade As String

Grade=NumericUpDown1.Value

If AverageRadioButton2.Checked Then Grade += 3
If AboveAverageRadioButton3.Checked Then Grade += 5
If OneDayLateRadioButton5.Checked Then Grade -= 5
If TwoDaysLateRadioButton6.Checked Then Grade = 0

' Now covert the results to a letter
Select Case Grade
    case 90 to 100 :  LetterGrade = "A"
    case 80 to 89:     LetterGrade = "B"
    ...
End Select

' Finally display the grade
GradeTextBox1.Text = LetterGrade

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.