lunes, 12 de noviembre de 2007

AREA DE UN CÍRCULO

Este es un programa donde el usuario ingresando el valor del radio del circulo obtendrá el área del dicho circulo utilizaremos tres botones “commandbuton” para utilizarlos como calcular, salir y nuevo








CODIGO_______________________________________________________________
'DECLARAMOS DOSVARIABLES
Dim AREA, PI As Double
Private Sub Command1_Click()
'ESTE ES EL BOTON CALCULAR
If Text1.Text = "" Then
MsgBox "DIGITE EL VALOR DEL RADIO EN LA CAJA DE TEXTO"
Else
PI = 3.1416
AREA = (Val(Text1.Text) * Val(Text1.Text)) * PI
MsgBox "EL AREA DEL CIRCULO ES " & AREA
End If
End Sub
Private Sub Command2_Click()
'BOTON SALIR
End
End Sub
Private Sub Command3_Click()
'BOTON NUEVO
Text1.Text = ""
Text1.SetFocus
End Sub