



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This consists of a program about simple calculator. It has source codes and screenshots of its output.
Typology: Lab Reports
1 / 6
This page cannot be seen from the preview
Don't miss anything!
Public Class Form Dim num1 As Double Dim num2 As Double Dim operations As Integer Dim operator_selector As Boolean = False Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 5 End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click If TextBox1.Text <> "0" Then TextBox1.Text += "1" Else TextBox1.Text = "1" End If End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 7 End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 6 End Sub Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 1 End Sub Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click If TextBox1.Text <> "0" Then TextBox1.Text += "3"
Else TextBox1.Text = "3" End If End Sub Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click If TextBox1.Text <> "0" Then TextBox1.Text += "5" Else TextBox1.Text = "5" End If End Sub Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 2 End Sub Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click If TextBox1.Text <> "0" Then TextBox1.Text += "6" Else TextBox1.Text = "6" End If End Sub Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click num1 = TextBox1.Text TextBox1.Text = "0" operator_selector = True operations = 3 End Sub Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click If TextBox1.Text <> "0" Then TextBox1.Text += "7" Else TextBox1.Text = "7" End If End Sub Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click If TextBox1.Text <> "0" Then TextBox1.Text += "2" Else TextBox1.Text = "2" End If End Sub Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click If TextBox1.Text <> "0" Then TextBox1.Text += "4" Else TextBox1.Text = "4" End If End Sub
Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click If TextBox1.Text <> "0" Then TextBox1.Text += "0" End If End Sub Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click TextBox1.Text = "" End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class