Read the flowing VB.NET program for the preceding GUI and fill the blanks. Note
ID: 3594110 • Letter: R
Question
Read the flowing VB.NET program for the preceding GUI and fill the blanks. Note that your answers must be consistent with your table in question 1.
1 Public Class Form1
2 Inherits System.Windows.____.Form
N V N N B.ET ET ET 113
© 2010 Taylor & Francis Group, LLC
3 Private Sub Form1_Load(ByVal sender As System.Object, _
4 ByVal e As System.EventArgs) Handles MyBase.Load
5
6 ComboBox1._____________("Computer")
7 ComboBox1._____________("Cell Phone")
8 ComboBox1._____________("Web Camera")
9 ComboBox1._____________("Laser Printer")
10 End Sub
11 Private Sub Button1_Click(ByVal sender As System.Object, _
12 __________ e As System.EventArgs) Handles Button1.Click
13 If (Val(TextBox1.Text) = 0) _
14 Or (ComboBox1.Text = "Choose Item") __________
15 MsgBox("Please Input your bid!", , "Missing input data")
16 Else
17 MsgBox("Offer is accepted. Please find the result!")
18 ______________
19 End Sub
20 Private Sub Button2_Click(ByVal sender As System.Object, _
21 ByVal e As System.EventArgs) Handles ______________
22 Dim CurrentHighestBid As ___________
23 If ComboBox1.Text = "Computer" Then
24 CurrentHighestBid = 1000
25 _____________
26 If ComboBox1.Text = "Cell Phone" Then
27 CurrentHighestBid = 200
28 End If
29 If ComboBox1.Text = "Web Camera" Then
30 CurrentHighestBid = 100
31 End If
32 If ComboBox1.Text = "Laser Printer" Then
33 CurrentHighestBid = 400
34 End If
35 If ____________(TextBox1.Text) > CurrentHighestBid Then
36 MsgBox("You win!", , "You win!")
37 Else
38 MsgBox("Sorry, your bid is not high enough. Bid again!")
39 End If
40 End Sub
41 _________
Explanation / Answer
For the Designing of above GUI below are the answers for fill in the blanks along with complete Table :
Answers of blanks in the code :
2. Forms
6. Items.Add
7. Items.Add
8. Items.Add
9. Items.Add
12. ByVal
14. Then
18. End If
21. Button2.Click
22. Integer
25. End If
35. Val
41. End Class
---------------Here is the Complete code after filling : -----------------------------
1 Public Class Form1
2 Inherits System.Windows.Forms.Form
N V N N B.ET ET ET 113
© 2010 Taylor & Francis Group, LLC
3 Private Sub Form1_Load(ByVal sender As System.Object, _
4 ByVal e As System.EventArgs) Handles MyBase.Load
5
6 ComboBox1.Items.Add ("Computer")
7 ComboBox1. Items.Add ("Cell Phone")
8 ComboBox1. Items.Add ("Web Camera")
9 ComboBox1. Items.Add ("Laser Printer")
10 End Sub
11 Private Sub Button1_Click(ByVal sender As System.Object, _
12 ByVal e As System.EventArgs) Handles Button1.Click
13 If (Val(TextBox1.Text) = 0) _
14 Or (ComboBox1.Text = "Choose Item") Then
15 MsgBox("Please Input your bid!", , "Missing input data")
16 Else
17 MsgBox("Offer is accepted. Please find the result!")
18 End If
19 End Sub
20 Private Sub Button2_Click(ByVal sender As System.Object, _
21 ByVal e As System.EventArgs) Handles Button2.Click
22 Dim CurrentHighestBid As Integer
23 If ComboBox1.Text = "Computer" Then
24 CurrentHighestBid = 1000
25 End If
26 If ComboBox1.Text = "Cell Phone" Then
27 CurrentHighestBid = 200
28 End If
29 If ComboBox1.Text = "Web Camera" Then
30 CurrentHighestBid = 100
31 End If
32 If ComboBox1.Text = "Laser Printer" Then
33 CurrentHighestBid = 400
34 End If
35 If Val(TextBox1.Text) > CurrentHighestBid Then
36 MsgBox("You win!", , "You win!")
37 Else
38 MsgBox("Sorry, your bid is not high enough. Bid again!")
39 End If
40 End Sub
41 End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.