Hi, I\'m trying to figure out a way to go about getting this program done. IT\'S
ID: 646417 • Letter: H
Question
Hi, I'm trying to figure out a way to go about getting this program done. IT'S A VISUAL BASIC PROGRAM. VISUAL BASIC, VISUAL BASIC. The instructions below are all I have to go on, but I'm really at a loss. Thanks!
-------------------------------------------------------------------------------
The local Monster shelter has a coding system for creatures. Mr. Shepherd the office manager has some people that never can remember what creatures the codes represent. You state by using parallel single-dimension arrays you will create a listbox that when the employee clicks on an animal type, the coding number will appear in a label. (NOTE: Only single dimension parallel arrays may be used for this exercise - yes I know you could use a two-dimensional array, but not this week). Hint: Listboxes have an event called .SelectedIndex
Animals=Codes
Blood Donors = 100
Shape Shifter= 200
Ghost = 300
Witch = 400
Warlock = 500
Chimaera = 600
Zombie = 700
Japanese (Godzilla, Mothra, Gamera) =800
Vampires=900
REMEMBER IT'S TO BE DONE IN VB - VISUAL BASIC
Explanation / Answer
Answer
Dim animal(9) As String
Dim codes(9) As Integer
Private Sub Form_Load()
c = 100
For i = 1 To 9
codes(i) = c
c = c + 100
Next
End Sub
Private Sub List1_Click()
a = List1.ListIndex
Label2.Caption = codes(a + 1)
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.