Question: In these Exercises of decisions from programming in Visual Basics, determine the output displayed in the text box when clicking the button. Private Sub btnDisplay_Click(...)

In these Exercises of decisions from programming in Visual Basics, determine the output displayed in the text box when clicking the button.

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click

Dim num As Double = 4 If num <= 9 Then

txtOutput.Text = "Less than ten."

Else

If num = 4 Then

txtOutput.Text = "Equal to four."

End If

End If

End Sub

2. Private Sub btnDisplay_Click(...) Handles btnDisplay. Click

Dim change As Double = 356 'Amount of change in cents

If change >= 100 Then

txtOutput.Text = "Your change contains " &

 Int(change / 100) & " dollars."
 Else
 txtOutput.Text = "Your change contains no dollars."

End If

End Sub

3. Private Sub btnCompute_Click(...) Handles btnCompute.Click Dim msg As String = "You are old enough to vote" Dim dateOfBirth As Date = CDate(InputBox("Enter your date of birth."))

If dateOfBirth.AddYears (18) <= Today Then

txtOutput.Text = msg & "."

Else

 txtOutput.Text = msg & " in " &
 DateDiff(DateInterval.Day, Today, dateOfBirth.AddYears(18)) &
 " days."

End If

End Sub

(Assume that your 18th birthday is one week away.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!