SlideShare a Scribd company logo
1 of 7
Calculator in EXCEL - VISUAL BASIC:

                                      Private Sub Command15_Click()
                                      num1 = Text1.Text
Dim op As String                      Text1.Text = ""
Dim num1 As Integer                   op = "/"
Dim num2 As Integer                   Command15.Visible = False
                                      Command21.Visible = True
Private Sub Command1_Click()          End Sub
Text1.Text = Text1.Text & 1
End Sub                               Private Sub Command16_Click()
                                      num1 = Text1.Text
Private Sub Command10_Click()         Text1.Text = ""
Text1.Text = Text1.Text & 0           op = "*"
End Sub                               Command16.Visible = False
                                      Command22.Visible = True
Private Sub Command11_Click()         End Sub
Text1.Text = Text1.Text & "."
End Sub                               Private Sub Command17_Click()
                                      Text1.Text = "0"
Private Sub Command12_Click()         End Sub
num2 = Text1.Text
If op = "+" Then                      Private Sub Command19_Click()
Text1.Text = num1 + num2              num2 = Text1.Text
ElseIf op = "/" Then                  If op = "+" Then
Text1.Text = num1 / num2              Text1.Text = num1 + num2
ElseIf op = "*" Then                  ElseIf op = "/" Then
Text1.Text = num1 * num2              Text1.Text = num1 / num2
ElseIf op = "-" Then                  ElseIf op = "*" Then
Text1.Text = num1 - num2              Text1.Text = num1 * num2
End If                                ElseIf op = "-" Then
End Sub                               Text1.Text = num1 - num2
                                      End If
Private Sub Command13_Click()         Command13.Visible = True
num1 = Text1.Text                     Command19.Visible = False
Text1.Text = ""                       End Sub
op = "+"
Command13.Visible = False             Private Sub Command2_Click()
Command19.Visible = True              Text1.Text = Text1.Text & 2
End Sub                               End Sub

Private Sub Command14_Click()         Private Sub Command20_Click()
num1 = Text1.Text                     num2 = Text1.Text
Text1.Text = ""                       If op = "+" Then
op = "-"                              Text1.Text = num1 + num2
Command14.Visible = False             ElseIf op = "/" Then
Command20.Visible = True              Text1.Text = num1 / num2
End Sub                               ElseIf op = "*" Then
                                      Text1.Text = num1 * num2
ElseIf op = "-" Then            Command16.Visible = True
Text1.Text = num1 - num2        Command22.Visible = False
End If                          End Sub
Command14.Visible = True
Command20.Visible = False       Private Sub Command3_Click()
End Sub                         Text1.Text = Text1.Text & 3
                                End Sub
Private Sub Command21_Click()
num2 = Text1.Text               Private Sub Command4_Click()
If op = "+" Then                Text1.Text = Text1.Text & 4
Text1.Text = num1 + num2        End Sub
ElseIf op = "/" Then
Text1.Text = num1 / num2        Private Sub Command5_Click()
ElseIf op = "*" Then            Text1.Text = Text1.Text & 5
Text1.Text = num1 * num2        End Sub
ElseIf op = "-" Then
Text1.Text = num1 - num2        Private Sub Command6_Click()
End If                          Text1.Text = Text1.Text & 6
End Sub                         End Sub

Private Sub Command22_Click()   Private Sub Command7_Click()
num2 = Text1.Text               Text1.Text = Text1.Text & 7
If op = "+" Then                End Sub
Text1.Text = num1 + num2
ElseIf op = "/" Then            Private Sub Command8_Click()
Text1.Text = num1 / num2        Text1.Text = Text1.Text & 8
ElseIf op = "*" Then            End Sub
Text1.Text = num1 * num2
ElseIf op = "-" Then            Private Sub Command9_Click()
Text1.Text = num1 - num2        Text1.Text = Text1.Text & 9
End If                          End Sub
Addition:   Subtraction:
Division:             Multiplication:




Calculator in TASM:
Addition:




Subtraction:
Division:




Multiplication:




,
Programming

More Related Content

Viewers also liked

Bastioni servizi pubbliciprivatizzati_finale_dic10
Bastioni servizi pubbliciprivatizzati_finale_dic10Bastioni servizi pubbliciprivatizzati_finale_dic10
Bastioni servizi pubbliciprivatizzati_finale_dic10Gilda Caronti
 
“Using Technology for Teaching and Learning in the 21st Century Classroom”
“Using Technology for Teaching and Learning in the 21st Century Classroom”“Using Technology for Teaching and Learning in the 21st Century Classroom”
“Using Technology for Teaching and Learning in the 21st Century Classroom”Shan E.
 
DISEGNO DI LEGGE 1758
DISEGNO DI LEGGE 1758 DISEGNO DI LEGGE 1758
DISEGNO DI LEGGE 1758 Gilda Caronti
 
Ran li 403
Ran li 403Ran li 403
Ran li 403liransky
 
Conciertos de U2 - U2fanlife.com
Conciertos de U2 - U2fanlife.comConciertos de U2 - U2fanlife.com
Conciertos de U2 - U2fanlife.comIvan Benito
 
Plugin forum professioni-ddl
Plugin forum professioni-ddlPlugin forum professioni-ddl
Plugin forum professioni-ddlGilda Caronti
 
Da genova destinazione nuovo mondo p ranieri
Da genova destinazione nuovo mondo p ranieriDa genova destinazione nuovo mondo p ranieri
Da genova destinazione nuovo mondo p ranieriGilda Caronti
 
Six stages of power and leadership
Six stages of power and leadershipSix stages of power and leadership
Six stages of power and leadershipNaveed Akhtar
 

Viewers also liked (12)

Tugas media
Tugas mediaTugas media
Tugas media
 
Bastioni servizi pubbliciprivatizzati_finale_dic10
Bastioni servizi pubbliciprivatizzati_finale_dic10Bastioni servizi pubbliciprivatizzati_finale_dic10
Bastioni servizi pubbliciprivatizzati_finale_dic10
 
Rl403
Rl403Rl403
Rl403
 
“Using Technology for Teaching and Learning in the 21st Century Classroom”
“Using Technology for Teaching and Learning in the 21st Century Classroom”“Using Technology for Teaching and Learning in the 21st Century Classroom”
“Using Technology for Teaching and Learning in the 21st Century Classroom”
 
DISEGNO DI LEGGE 1758
DISEGNO DI LEGGE 1758 DISEGNO DI LEGGE 1758
DISEGNO DI LEGGE 1758
 
Ran li 403
Ran li 403Ran li 403
Ran li 403
 
Conciertos de U2 - U2fanlife.com
Conciertos de U2 - U2fanlife.comConciertos de U2 - U2fanlife.com
Conciertos de U2 - U2fanlife.com
 
Plugin forum professioni-ddl
Plugin forum professioni-ddlPlugin forum professioni-ddl
Plugin forum professioni-ddl
 
Da genova destinazione nuovo mondo p ranieri
Da genova destinazione nuovo mondo p ranieriDa genova destinazione nuovo mondo p ranieri
Da genova destinazione nuovo mondo p ranieri
 
Six stages of power and leadership
Six stages of power and leadershipSix stages of power and leadership
Six stages of power and leadership
 
Carbon nanotubes
Carbon nanotubesCarbon nanotubes
Carbon nanotubes
 
Aluminium Alloys
Aluminium AlloysAluminium Alloys
Aluminium Alloys
 

Similar to Programming

Similar to Programming (8)

Vb file
Vb fileVb file
Vb file
 
Vbreport
VbreportVbreport
Vbreport
 
Vbreport program
Vbreport programVbreport program
Vbreport program
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Check box, image
Check box, imageCheck box, image
Check box, image
 
Laboratory activity 3 b1
Laboratory activity 3 b1Laboratory activity 3 b1
Laboratory activity 3 b1
 

Programming

  • 1. Calculator in EXCEL - VISUAL BASIC: Private Sub Command15_Click() num1 = Text1.Text Dim op As String Text1.Text = "" Dim num1 As Integer op = "/" Dim num2 As Integer Command15.Visible = False Command21.Visible = True Private Sub Command1_Click() End Sub Text1.Text = Text1.Text & 1 End Sub Private Sub Command16_Click() num1 = Text1.Text Private Sub Command10_Click() Text1.Text = "" Text1.Text = Text1.Text & 0 op = "*" End Sub Command16.Visible = False Command22.Visible = True Private Sub Command11_Click() End Sub Text1.Text = Text1.Text & "." End Sub Private Sub Command17_Click() Text1.Text = "0" Private Sub Command12_Click() End Sub num2 = Text1.Text If op = "+" Then Private Sub Command19_Click() Text1.Text = num1 + num2 num2 = Text1.Text ElseIf op = "/" Then If op = "+" Then Text1.Text = num1 / num2 Text1.Text = num1 + num2 ElseIf op = "*" Then ElseIf op = "/" Then Text1.Text = num1 * num2 Text1.Text = num1 / num2 ElseIf op = "-" Then ElseIf op = "*" Then Text1.Text = num1 - num2 Text1.Text = num1 * num2 End If ElseIf op = "-" Then End Sub Text1.Text = num1 - num2 End If Private Sub Command13_Click() Command13.Visible = True num1 = Text1.Text Command19.Visible = False Text1.Text = "" End Sub op = "+" Command13.Visible = False Private Sub Command2_Click() Command19.Visible = True Text1.Text = Text1.Text & 2 End Sub End Sub Private Sub Command14_Click() Private Sub Command20_Click() num1 = Text1.Text num2 = Text1.Text Text1.Text = "" If op = "+" Then op = "-" Text1.Text = num1 + num2 Command14.Visible = False ElseIf op = "/" Then Command20.Visible = True Text1.Text = num1 / num2 End Sub ElseIf op = "*" Then Text1.Text = num1 * num2
  • 2. ElseIf op = "-" Then Command16.Visible = True Text1.Text = num1 - num2 Command22.Visible = False End If End Sub Command14.Visible = True Command20.Visible = False Private Sub Command3_Click() End Sub Text1.Text = Text1.Text & 3 End Sub Private Sub Command21_Click() num2 = Text1.Text Private Sub Command4_Click() If op = "+" Then Text1.Text = Text1.Text & 4 Text1.Text = num1 + num2 End Sub ElseIf op = "/" Then Text1.Text = num1 / num2 Private Sub Command5_Click() ElseIf op = "*" Then Text1.Text = Text1.Text & 5 Text1.Text = num1 * num2 End Sub ElseIf op = "-" Then Text1.Text = num1 - num2 Private Sub Command6_Click() End If Text1.Text = Text1.Text & 6 End Sub End Sub Private Sub Command22_Click() Private Sub Command7_Click() num2 = Text1.Text Text1.Text = Text1.Text & 7 If op = "+" Then End Sub Text1.Text = num1 + num2 ElseIf op = "/" Then Private Sub Command8_Click() Text1.Text = num1 / num2 Text1.Text = Text1.Text & 8 ElseIf op = "*" Then End Sub Text1.Text = num1 * num2 ElseIf op = "-" Then Private Sub Command9_Click() Text1.Text = num1 - num2 Text1.Text = Text1.Text & 9 End If End Sub
  • 3. Addition: Subtraction:
  • 4. Division: Multiplication: Calculator in TASM: