-
Mar 28th, 2018, 12:16 AM
#1
Thread Starter
New Member
-
Mar 28th, 2018, 03:09 AM
#2
Member
Re: Final Grade Calculator
Code:
txtoverall.text =( val(txthw.text) + val(txtquizzes.text) +
val(txtmidtem.text) + val(txtfinal.text) ) / 4
-
Mar 28th, 2018, 05:20 AM
#3
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.
-
Feb 27th, 2021, 08:36 AM
#4
New Member
Re: Final Grade Calculator
Originally Posted by Merq
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
-
Feb 27th, 2021, 11:13 AM
#5
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.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 20th, 2024, 12:16 AM
#6
Re: Final Grade Calculator
Originally Posted by goodstudent
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.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 20th, 2024, 01:30 AM
#7
Re: Final Grade Calculator
Originally Posted by .paul.
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.
-
Mar 20th, 2024, 07:44 AM
#8
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
-
Mar 20th, 2024, 07:54 AM
#9
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>
-
Mar 20th, 2024, 01:34 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|