In visual basic with Option Explicit On Option Strict On Option Infer Off Unzip
ID: 3791674 • Letter: I
Question
In visual basic
with
Option Explicit On
Option Strict On
Option Infer Off
Unzip and open the Odd Squares SolutionOdd Squares Solution.sln file. Code the Display button's Click event procedure so that it displays the squares of the odd integers from 1 through 9 in the squaresLabel. Display each square on a separate line in the the control using the For...Next statement. Save the solution and then start and test the application. Close and submit this week's entire project folder into a single zip file. Submit the zip file to the form inside this folder.
Unable to upload picture.
Has a square label display box Display button
Exit Button
Explanation / Answer
Public Class DisplayForm
' Display button click event handler
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
' Iterating loop from 1 to 9 with step 2
For number As Integer = 1 To 9 Step 2
'writing result to text box
SquaresLabel.Text += (number * number).ToString() & Environment.NewLine
Next
End Sub
' Exit button click event handler
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Application.Exit()
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.