Write a project in visual basic to do the Mathematical operation (+,-,*, /, \ , mod, ^ ) and adding (print, Exit) to the project by using (Button , RadioButton ,Checkbox) as shown in figure below ? Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a+b TextBox3.Text = c.ToString End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a-b TextBox3.Text = c.ToString End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a*b TextBox3.Text = c.ToString End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a/b TextBox3.Text = c.ToString End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a\b TextBox3.Text = c.ToString End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c = a Mod b TextBox3.Text = c.ToString End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a^b TextBox3.Text = c.ToString End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click End End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a+b TextBox3.Text = c.ToString End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a-b TextBox3.Text = c.ToString End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a*b TextBox3.Text = c.ToString End Sub Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a/b TextBox3.Text = c.ToString End Sub Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a\b TextBox3.Text = c.ToString End Sub Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c = a Mod b TextBox3.Text = c.ToString End Sub Private Sub RadioButton7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton7.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a^b TextBox3.Text = c.ToString End Sub Private Sub RadioButton9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton9.CheckedChanged PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub RadioButton8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton8.CheckedChanged End End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a+b TextBox3.Text = c.ToString End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a-b TextBox3.Text = c.ToString End Sub Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a*b TextBox3.Text = c.ToString End Sub Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a/b TextBox3.Text = c.ToString End Sub Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a\b TextBox3.Text = c.ToString End Sub Private Sub CheckBox6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox6.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c = a Mod b TextBox3.Text = c.ToString End Sub Private Sub CheckBox7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox7.CheckedChanged Dim a, b, c As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox2.Text) c=a^b TextBox3.Text = c.ToString End Sub Private Sub CheckBox8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox8.CheckedChanged PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub CheckBox9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox9.CheckedChanged End End Sub End Class Note : 1. We use the statements (dim) declares the variables and their data types Vb data type Use for Boolean True or false value Byte 0 to 255 binary data Char Single Unicode charcter Date 1/1/0001 to 12/31/9999 Decimal Decimal fraction such as dollars and cents Single Single –precision floating point numbers Double Double –precision floating point numbers with 14 digits of accuracy Short Small integer in rang - 32,768 to 32,768 Integer Whole number in range -2,147,483.648 to 2,147,483.648 Long Larger whole numbers String Alphanumeric data,letters,digits and other Characters Objects Any type of data 2.we use Parse Method to convert the textbox contents to numeric and places the value into the variable A= integer.parse(textbox1.text) B=decimal.parse(textbox2.text) 3. we use Tostring Method to convert any of the numeric data types to a string value. Textbox3.text=C.Tostring() Write a project in visual basic to input sales information for book (Quantity, Title,Price) for Calculation the extended price and discount for a sale when discount values is 15% and adding (clear sales , print, Exit) to the project by using (Button , RadioButton ,Checkbox) as shown in figure below? Public Class Form1 Const Z As Decimal = 0.15D Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a, b, c, f, h As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox3.Text) c=a*b f = Decimal.Round((c * Z), 2) h=c-f TextBox4.Text = c.ToString TextBox5.Text = f.ToString TextBox6.Text = h.ToString End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click With TextBox1 .Clear() .Focus() End With TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Dim a, b, c, f, h As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox3.Text) c=a*b f = Decimal.Round((c * Z), 2) h=c-f TextBox4.Text = c.ToString TextBox5.Text = f.ToString TextBox6.Text = h.ToString End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged With TextBox1 .Clear() .Focus() End With TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged End End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged Dim a, b, c, f, h As Decimal a = Decimal.Parse(TextBox1.Text) b = Decimal.Parse(TextBox3.Text) c=a*b f = Decimal.Round((c * z), 2) h=c-f TextBox4.Text = c.ToString TextBox5.Text = f.ToString TextBox6.Text = h.ToString End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged With TextBox1 .Clear() .Focus() End With TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() End Sub Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged End End Sub End Class Note : 1. We use the statements (Const) declares the Constant ,as shown in project above .and use the variable in project when need for it. Const Z as decimal=0.15D Where d at the end used to define the type of data. 2. The Decimal.Round method returns a decimal result to the specified number of decimal positions,which can be an integer in the range 0-28 f = Decimal.Round((c * Z), 2) 3. You can clear out the contents of a textbox or label by setting the property to empty string use ""(no space between the two quotation marks).this empty string is also called a null string or zero-length string.you can also clear out a textbox using the clear method or setting the text property to string.empty note that the clear method works for text boxes but not for labels. Textbox1.text="" or Textbox1.clear() Label1.text="" or Label1.text=string.Empty 4. As your program runs,you want the insertion point to appear in the textbox where the user is expected to type . the focus should therefore begin in the first textbox . if you clear the form textbox you should reset the focus to the first textbox .the Focus method handles the situation. Textbox1.focus() 5. You specify an object name in the With statement.all subsequent statements until the end with relate to the object. With textbox1 .visible=true .forecolor=color.white .focus() End with