?
Solved

Grader

Posted on 2004-11-22
13
Medium Priority
?
234 Views
Last Modified: 2010-04-24
I have an input of a numericupdowncontrol and two of groupsof radiobuttons:
Radio button group1(Credits)
rad1 = +0
rad2 =+3
rad3 = +5
Radio button group2(Penalties)
rad4 = +0
rad4 = -5
rad4 = automatic 0 score
And my output grade is(textbox)(button Compute)
A=> 90
B =[80..89]
C =[70..79]
D =[60..69]
F =[0..59]
I can calculate the first group of radio buttons usingt if and then button click procedure but cant add the second group of radio buttonsto the final answer.also the grade  how do you code if final grade = 80..89 then etc. thanks i  i really appreciate your help
0
Comment
Question by:Barako2
  • 8
  • 4
13 Comments
 
LVL 6

Expert Comment

by:platinumbay
ID: 12648958
Can you post your code, please?
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 12649102
Yes...since this is definitely a homework assignment we need to see what work you have done already.

~IM
0
 

Author Comment

by:Barako2
ID: 12649191
Button click Event
i can calculate it using atextbox as an input but dont know a numeric up down control  
Test Score = TextBox1.Text
Dim RoughGrade As Double
If radio Button1 checked = True Then
RoughGrade TextBox1.Text + 0
If RadioButton2 checked = True Then
RoughGrade =TextBox1Text + 3
If RadioButton3 checked = True Then
RoughGrade = TextBox1Text + 5
I think this is wrong

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Accepted Solution

by:
platinumbay earned 2000 total points
ID: 12649872
Is this what you are trying to do?

    Private Function CalcGrade() As String
        Dim RoughGrade As Integer

        If RadioButton1.Checked Then
            RoughGrade += 0
        End If
        If RadioButton2.Checked Then
            RoughGrade += 3
        End If
        If RadioButton3.Checked Then
            RoughGrade += 5
        End If
        If RadioButton4.Checked Then
            RoughGrade += 0
        End If
        'etc...

        Dim Grade As String
        Select Case RoughGrade
            Case Is >= 90
                Grade = "A"
            Case Is >= 80
                Grade = "B"
            Case Is >= 70
                Grade = "C"
            Case Is >= 60
                Grade = "D"
            Case Else
                Grade = "F"
        End Select
        Return Grade
    End Function
0
 

Author Comment

by:Barako2
ID: 12650470
yeah somewhat like that but i cant add the other group of radio buttons by the way i forgot the labels
Extra credit
None = 0 points
Average = 3 points
Above average = 5 points
Penalties
On Time= 0 penalty
2 days late= 5 point penalty
2+ days late= 0 grade
0
 
LVL 6

Expert Comment

by:platinumbay
ID: 12651166
What do you mean you can't add the other group of radio buttons?
0
 

Author Comment

by:Barako2
ID: 12651276
since each group of radio buttons is in a group box.
Tips:Declare global variables by placingthe Dim statement outside all methods
*gdbExtraCredit: to remember how much extra-credit should be given
*gdbLate: remember how much late penalty should be taken off depending on wheteher its on time, 1-2 days late or more than 2 days late
*For each radio button, code a sub that handles the checkedchanged event
   for example:
Private sub
rad1_2daylate_checkedChanged(...)
gdblate = -5
>Use a group of radiobutton controls to determine the grade on extra credit
>Use a second group of radio buttons to determine whether a student handed in the assignment on time with the default on time . the other choices are 1-2 days late (5 point penalty)
 and more than 2 days late( automatic score of zero)
> display the final total grade in a read-only textbox control. Use global variables to keep track of which radio button control is checked before determining the final grade.




0
 

Author Comment

by:Barako2
ID: 12651843
When i debug the program i cant select aradio button in the second group
0
 
LVL 6

Expert Comment

by:platinumbay
ID: 12651896
Can you show us your code?  It is hard to guess what your project looks like.  Does the second group have a different name from the first group?
0
 

Author Comment

by:Barako2
ID: 12651991
i tried your code its the same thing. Yes groupbox1 and groupbox2
0
 

Author Comment

by:Barako2
ID: 12652009
If you want ill e-mail you the user interface so you can see how it works
0
 

Author Comment

by:Barako2
ID: 12652180
Thanks i Finally figured it out
0
 

Author Comment

by:Barako2
ID: 12652186
There was extra code thats why the second group of buttonscant be accessed. Thank you very much platinumBay . Ill accept your answer.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question