This code defines a form with two buttons and menu items. Button1 demonstrates the associative property by displaying the equation "(a+b)+c=a+(b+c)" in a label. Button2 demonstrates the commutative property by displaying "a+b=b+a". The Exit menu item exits the application, while the other two menu items perform the same actions as the buttons by displaying the respective equations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
82 views1 page
Exercise 5
This code defines a form with two buttons and menu items. Button1 demonstrates the associative property by displaying the equation "(a+b)+c=a+(b+c)" in a label. Button2 demonstrates the commutative property by displaying "a+b=b+a". The Exit menu item exits the application, while the other two menu items perform the same actions as the buttons by displaying the respective equations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Exercise 5
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "(a+b)+c=a+(b+c)" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Label1.Text = "a+b=b=a" End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Application.Exit() End Sub Private Sub AssociativeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AssociativeToolStripMenuItem.Click Label1.Text = "(a+b)+c=a+(b+c)" End Sub Private Sub CommutiativeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommutiativeToolStripMenuItem.Click Label1.Text = "a+b=b=a" End Sub End Class