Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This code is in the visual basic programming language. 1. Using the code below,

ID: 3602459 • Letter: T

Question

This code is in the visual basic programming language.

1. Using the code below, describe what each numbered line does when the code is executed Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close0) End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click Dim intRegistered As Integer Dim intPricePerPerson As Integer Dim intTotalOwed As Integer Integer.TryParse(txtNumber.Text, intRegistered) If intRegistered 10 Then intPricePerPerson 80 Else intPricePerPerson-100 End If intTotalOwed intRegistered intPricePerPerson iblTotal.Text intTotalowed.ToString("CO") End Sub

Explanation / Answer

btnExit_Click()

Me.Close() - when the command button is clicked, it closes the window.

btnCalc_Click()

intRegistered, intPricePerPerson, intTotalOwed are the three diferent variables are declared as integer

Integer.TryParse(txtNumber.Text, intRegistered) - it convert the text to integer

if the value of given varaible intRegistered > 10 the the value 80 is assigned to the variable intPricePerPerson otherwise (ie) if the value of the variable intRegistered < 10 then the value 100 is assigned to the variable intPricePerPerson.

Then the value of the variable intRegisteres is multiplied with the value of the variable intPricePerPerson and then it is stored in the variable intTotalOwed. Then the value is converted to string finally.