Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

Need help: Grade program - Constants and Functions

$
0
0
Hey there,

So I have this problem. I've been working tirelessly with VisualBasic 2010 on an assignment for my CS 105 class. The assignment seemed pretty straightforward: Make a program with checkboxes that calculates our grades on certain assignments. I thought I had it down, but here's the catch:

We MUST use global constants to store the weighted grade value of assignments. And -

We MUST use a function to calculate and display the total grade using the user's entered score on their assignment (out of 100 points).

I worked forever on this trying different things, and eventually one warning I received locked me out of design view. I deleted all possible signs of the error, but it persisted. It's looking as if I may need to start from scratch, and I'm running out of time quickly.

So more to the point: Could anyone help me develop a function that takes these global constants:

'Declare Global variables
Const lab2Grade As Decimal = 0.05
Const lab3Grade As Decimal = 0.1
Const lab4Grade As Decimal = 0.1
Const lab5Grade As Decimal = 0.1
Const exam1Grade As Decimal = 0.2
Const exam2Grade As Decimal = 0.3
Const finalProjGrade As Decimal = 0.15

And using the user input through text boxes on each assignment where scores are entered out of 100, convert it into an average score that I can convert to a percent and display (Done through a button-click event)? I had it working without functions, but as functions are part of the assignment I'm forced to use them to get a decent grade, and I'm very new to them. If anyone could help, that would be fantastic. :)

Thanks for reading!

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>