Write a program in Visual Basic to find out how many horses are standing in the field.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Declare variables
Dim I, O, B, horses As Integer
'Set values
O = 33
I = 15
B = 7
horses = O - I + B
'Display results
MessageBox.Show("There are " & horses & " horses in the field.")
End Sub
End Class
No comments:
Post a Comment