Help Quick
|
View this Thread in Original format
Vivid Boy |
doing an exam right now all u Visual Basic whizzes plz help me out
heres the question i need help on
--------------------------------------------------------------------------------
Question 12 (5 points)
Write a Procedure named DisplayMessage that accepts a student's
score (intScore) and displays a message in a picture box named
picMessage. Use a Select Case statement to decide which message to
print.
If the Score is Display
- less than 59 - You can do it!
- equal to 59, 69, 79 or 89 - You almost made a better grade.
- greater than 79 - Excellent!
- None of the above - Good Work!
Also write the event procedure to handle the click event for
cmbDisplay. This event procedure will:
- take the value from txtScore
- print the message in picMessage |
|
|
Agent_WD40 |
This should get ya going. I haven't done vb for about a year but this should work fine. Add error checking and whatever else you gotta do and it should work for ya. If you need anymore help just let me know.
Option Explicit
Private Sub DisplayMessage(intScore As Integer)
Select Case intScore
Case 0 To 58
picMessage.Print "You Can Do It!"
Case 59, 69, 79, 89
picMessage.Print "You almost made a better grade."
Case Is > 79
picMessage.Print "Excellent"
Case Else
picMessage.Print "Good Work!"
End Select
End Sub
Private Sub cmdDisplay_Click()
Dim intScore As Integer
intScore = txtScore.Text
DisplayMessage (intScore)
End Sub |
|
|
tranceDJ |
hm...doesn't look like that helped him, it was posted about 2hours after vivid posted, that sux, I hope you were able to do it Vivid:) |
|
|
Agent_WD40 |
Yeah, I noticed that to. I was hoping that it would be a take home test due at then end of the day or in a few hours or something. I tried. |
|
|
Vivid Boy |
thnx alot agent for ur help...but i failed lol....but i got two other answers off some kid next to me so hopefully i got the multiple choice right and i passed with a 50 |
|
|
|
|