0% found this document useful (0 votes)
31 views2 pages

Program Task: Calculator

The document describes a simple calculator program that demonstrates addition, subtraction, multiplication, and division functions. The program defines integer variables to store two numbers and the result. It includes subroutines for each calculation function that retrieve the numbers from text boxes, perform the calculation, and output the result to a third text box. Additional subroutines are included to unload and reset the form.

Uploaded by

The Awesome
Copyright
© Attribution Non-Commercial (BY-NC)
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% found this document useful (0 votes)
31 views2 pages

Program Task: Calculator

The document describes a simple calculator program that demonstrates addition, subtraction, multiplication, and division functions. The program defines integer variables to store two numbers and the result. It includes subroutines for each calculation function that retrieve the numbers from text boxes, perform the calculation, and output the result to a third text box. Additional subroutines are included to unload and reset the form.

Uploaded by

The Awesome
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 2

August 1, 2012

[PROGRAM NUMBER 1: SIMPLE CALCULATOR]

Program Task: To Demonstrate The Functions Of A Simple Calculator

Dim n1 As Integer Dim n2 As Integer Dim result As Integer Private Sub Command3_Click() n1 = Text1.Text n2 = Text2.Text result = n1 + n2 Text3.Text = Val(result) End Sub Private Sub Command4_Click() n1 = Text1.Text n2 = Text2.Text result = n1 - n2 Text3.Text = Val(result) End Sub Private Sub Command5_Click() n1 = Text1.Text n2 = Text2.Text result = n1 * n2 Text3.Text = Val(result) End Sub Private Sub Command6_Click() n1 = Text1.Text n2 = Text2.Text result = n1 / n2 Text3.Text = Val(result) End Sub Private Sub Command7_Click() Unload Me End Sub Private Sub Command8_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub

Syeda Narjis Fatima Zaidi

Page 1

August 1, 2012

[PROGRAM NUMBER 1: SIMPLE CALCULATOR]

GUI:

Syeda Narjis Fatima Zaidi

Page 2

You might also like