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

Visual Basic- This is my assignment: Create a program the allows the user to per

ID: 3787215 • Letter: V

Question

Visual Basic- This is my assignment:

Create a program the allows the user to perform mathematical operations on two numbers. The GUI should include text boxes to enter the numbers and command buttons to trigger the operations listed below.

1.Addition

2.Subtraction

3.Multiplication

4.Long Division (returns real numbers)

5.Integer Division (returns whole numbers)

6.Modulus

7.Exponention

After clicking one of the buttons, the entire formula and its result should be added to a list box. For example, if a user performs all seven operations the list box should contain all seven formula and answer sets.

These are my controls. How do I even start the coding for this?

DA WindowsApplication4 Microsoft Visual Studio Edit Project Build Debug Team Format Tool Test Analyze Window Start Debug Any CPU v X frmMathops.vb frmMathops.vb Design X Toolbox Search Toolbox BackgroundWorker a Binding Navigator Bindingsourc But st0utput CheckBox CheckedListBox ColorDialog ComboBox ContextMenuStrip DataGridView E Subtract Dataset Mutply Long Divide DateTimePicker Divide Mod Exponent DirectoryEntry Directory searcher C De UpDown ErrorProvider a EventLog FileSystemWatcher FlowLayoutpanel Dialog DER Font Dialog Group Box HScrollBa Show output from: IntelliSense ImageList abel oolbox Output Serve Error List Ready Help 78, 58 20x95 Y4 P Quick Launch (Ctrl+Q) Sign in Solution Explorer Search Solution Explorer (Ctrl Solution WindowsApplication4 proj WindowsApplication4 My Project D References App.config EB frmMathops.vb Solution Explorer Team Explorer Class View lstoutput System, Windows Forms,ListBox El Data E pplicationsetting ngs Data Saul Display Member (none) (Collection) Items The ite he list box Publish 2.50 PM 2/4/2017

Explanation / Answer

Initially lets assume that your first text box id is Text1 and second text box id is Text2. The text box in which we will capture the result will suppose have id Text3.

We also have Dim val1, val2, result as double

1. Code for Addition: For addition you have to write code in such a way that on "Add" Button click, the values must be taken from both the text box and result should be displayed in the output text box. Code for the same should be as follows:

Private Sub Add_Button_Click()
val1 = Val(Text1.Text)
val2 = Val(Text2.Text)
result = val1 + val2
Text3.Text = result
End Sub

2. Code for Substraction: For substraction you have to write code in such a way that on "Subtract" Button click, the values must be taken from both the text box and result should be displayed in the output text box. Code for the same should be as follows:

Private Sub Substraction_Button_Click()
val1 = Val(Text1.Text)
val2 = Val(Text2.Text)
result = val1 + val2
Text3.Text = result
End Sub

3. Code for Multiplication: For multiplication you have to write code in such a way that on "Multiply" Button click, the values must be taken from both the text box and result should be displayed in the output text box. Code for the same should be as follows:

Private Sub Multiplication_Button_Click()
val1 = Val(Text1.Text)
val2 = Val(Text2.Text)
result = val1*val2
Text3.Text = result
End Sub

4. Code for Division: For division you have to write code in such a way that on "Long Divide" Button click, the values must be taken from both the text box and result should be displayed in the output text box. Code for the same should be as follows:

Private Sub Long_Divide_Button_Click()
val1 = Val(Text1.Text)
val2 = Val(Text2.Text)
result = val1/val2
Text3.Text = result
End Sub