Results 1 to 10 of 10

Thread: Final Grade Calculator

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2018
    Posts
    4

    Final Grade Calculator

    working on a final grade calculator (Pics inserted below). Anyways, i figured out how to calculate the grades (A, B, C, D, F) but am unable to get the AVG/Overall score. I am getting errors with the txt which you will see below. I copied the code from a past assignment but it seems to be messing up. im not sure what to do, if anyone can help and lead me to the right direction, that would be great. thanks a lot.

    Name:  grade.PNG
Views: 6099
Size:  12.3 KB
    Name:  333.jpg
Views: 4247
Size:  27.3 KB
    Name:  44.PNG
Views: 4452
Size:  18.5 KB

  2. #2
    Member
    Join Date
    Oct 2011
    Posts
    60

    Re: Final Grade Calculator

    Code:
    txtoverall.text =( val(txthw.text) +  val(txtquizzes.text) + 
                                       val(txtmidtem.text)  +  val(txtfinal.text) ) / 4

  3. #3
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Final Grade Calculator

    You'll also have to weight the scores, since Homework accounts for 10% of the overall score, and the Final Exam counts for 40% the Final Exam is worth four times as much as homework. If you had 0 for homework, and 100 for the final, a straight average of the two would be 50, which would be an F. That doesn't seem fair, you obviously know the subject.
    The weighted average would be 80, so you should get a B.
    Of course, you won't get a B with your Select Case. 90 to 89.999 is a very slim window, and it is backwards so may not even trigger, I don't know. I haven't tried a negative range.

  4. #4
    New Member
    Join Date
    Feb 2021
    Posts
    1

    Question Re: Final Grade Calculator

    Quote Originally Posted by Merq View Post
    working on a final grade calculator (Pics inserted below). Anyways, i figured out how to calculate the grades (A, B, C, D, F) but am unable to get the AVG/Overall score. I am getting errors with the txt which you will see below. I copied the code from a past assignment but it seems to be messing up. im not sure what to do, if anyone can help and lead me to the right direction, that would be great. thanks a lot.

    Name:  grade.PNG
Views: 6099
Size:  12.3 KB
    Name:  333.jpg
Views: 4247
Size:  27.3 KB
    Name:  44.PNG
Views: 4452
Size:  18.5 KB
    hey, I'm trying to work on same project and completely new to programming. Please can you share with me your project or the code? Thanks

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: Final Grade Calculator

    Code:
    Dim d1 As Decimal
    Dim d2 As Decimal
    Dim d3 As Decimal
    Dim d4 As Decimal
    
    If Decimal.Tryparse(txtHW.Text, d1) AndAlso Decimal.Tryparse(txtQuizzes.Text, d2) AndAlso Decimal.Tryparse(txtMidterm.Text, d3) AndAlso Decimal.Tryparse(txtFinal.Text, d4) Then
        Dim score As Decimal = ((d1 + (d2 * 2) + (d3 * 3) + (d4 * 4)) / 10) ' weighted average
        txtOverall.Text = score.ToString
    
        Select Case score
            Case 90 to 100
                txtLetter.Text = "A"
            Case 80 to 89.999
                txtLetter.Text = "B"            
            Case 70 to 79.999
                txtLetter.Text = "C"            
            Case 60 to 69.999
                txtLetter.Text = "D"            
            Case 0 to 59.999
                txtLetter.Text = "F"            
        End Select
    
    End If
    Last edited by .paul.; Feb 27th, 2021 at 11:17 AM.

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: Final Grade Calculator

    Quote Originally Posted by goodstudent View Post
    If you're having trouble calculating your final grade, I can recommend an online grading website that I use. It is at final-grade calculator dot com
    A grade calculator is a common programming homework assignment.
    You do realise you’ve just revived a three year old thread?
    Last edited by Shaggy Hiker; Mar 20th, 2024 at 07:42 AM.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: Final Grade Calculator

    Quote Originally Posted by .paul. View Post
    You do realise you’ve just revived a three year old thread?
    Almost certainly for the purposes of future spam, given that it also adds no programming value. Post deleted.

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Final Grade Calculator

    Probably not even future spam. There was a link, which I removed from the quote that .paul. made. It wasn't an obviously commercial site, so perhaps that wasn't the spam part, or maybe it was just an SEO move. The site was actually pretty strange. It appeared to be just what it said it was: An online grade calculator. I hope it wasn't for math students.
    My usual boring signature: Nothing

  9. #9
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,121

    Re: Final Grade Calculator

    You do realize that Case 80 to 89.999 after Case 90 to 100 is unnecessary complication with all the digits after the floating point which OP introduced out of pure cluelessness.

    Just use Case 80 to 90 and be sure 90 will never enter this case because it will be handled by the Case 90 to 100 before it. You can even use Case 80 to 100 to emphasize this fact like this:

    Code:
        Select Case score
            Case 90 to 100
                txtLetter.Text = "A"
            Case 80 to 100
                txtLetter.Text = "B"            
            Case 70 to 100
                txtLetter.Text = "C"            
            Case 60 to 100
                txtLetter.Text = "D"            
            Case 0 to 100
                txtLetter.Text = "F"            
        End Select
    Edit: Hope this is true for VB.Net -- I didn't realize which sub-forum this post is in.

    cheers,
    </wqw>

  10. #10
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Final Grade Calculator

    Might as well close this. The thread is six years old. If the OP is still working on this assignment, it's debatable whether or not they are getting the most out of their education. It all depends on whether you favor quality or quantity.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width