Question
Question: use The following code with visual basic to add comments to everyline explaing what that particular line does. also explain what this program does.
Question: use The following code with visual basic to add comments to everyline explaing what that particular line does. also explain what this program does.
Public Class Main_Form
Dim Augend As Integer Dim Addend As Integer Dim Subtrahend As Integer Dim Minuend As Integer
Private Sub Main_Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Randomize()
Augend = CInt(Int((999 * Rnd()) + 1)) Addend = CInt(Int((999 * Rnd()) + 1)) Subtrahend = CInt(Int((999 * Rnd()) + 1)) Minuend = CInt(Int((999 * Rnd()) + 1))
lbl_Augend.Text = Augend lbl_Addend.Text = Addend lbl_Subtrahend.Text = Subtrahend lbl_Minuend.Text = Minuend
End Sub
Private Sub btn_Score_Click(sender As Object, e As EventArgs) Handles btn_Score.Click
Dim Sum As Integer Dim Difference As Integer
Dim Input_Sum As Integer Dim Input_Difference As Integer
Sum = Augend + Addend Difference = Subtrahend - Minuend
Input_Sum = Convert.ToInt32(txt_Sum.Text) Input_Difference = Convert.ToInt32(txt_Difference.Text)
If Input_Sum = Sum Then txt_Sum.ForeColor = Color.Black Else txt_Sum.ForeColor = Color.Red End If
If Input_Difference = Difference Then txt_Difference.ForeColor = Color.Black Else txt_Difference.ForeColor = Color.Red End If
End Sub
Private Sub btn_Close_Click(sender As Object, e As EventArgs) Handles btn_Close.Click Me.Close()
End Sub
End Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started