Professional Documents
Culture Documents
27.- Escribir un programa que pida la nota de un examen (un nro. real
entre 0 y 100) e imprima por pantalla la calificacin en formato
36.- Disenar un programa que multiplique dos nmeros enteros sin usar
operadores.
n As Integer
pri As Integer
seg As Integer
c As Integer
c2 As Integer
div As Integer
c3 As Integer
n=0
pri = 0
seg = 1
c=1
While c < 11
c2 = 1
c3 = 0
While c2 <= n
div = n Mod c2
If div = 0 Then
c3 = c3 + 1
End If
c2 = c2 + 1
End While
If c3 = 2 Then
MsgBox(n)
c=c+1
End If
pri = seg
seg = n
n = pri + seg
End While
End Sub
38.- Disear un programa que convierta un monto x de pesos a
bolivianos.
Private Sub Command1_Click()
Dim d, peso, conversion As Single
d = dolar.Text
peso = pesos.Text
conversion = Val(peso) / Val(d)
respuesta.Caption = "La cantidad de pesos insertada equivale a " &
conversion & " Dlares"
End Sub
39.- Escribir un programa que lea 5 nmeros enteros y escriba la media
aritmtica (Promedio) de los mismos.
PrimerValor As Integer
SegundoValor As Integer
TercerValor As Integer
CuartoValor As Integer
QuintoValor As Integer
PrimerValor = Text1
SegundoValor = Text2
TercerValor = Text3
CuartoValor = Text4
QuintoValor = Text5
Label7 = (PrimerValor + SegundoValor + TercerValor + CuartoValor +
QuintoValor) /5
End Sub
40.- Escribir un programa que solicite al usuario la introduccin de un
nmero de tres dgitos y que lo imprima en orden inverso. Ejemplo: Para
una entrada de 695,la salida deber ser 596.
Private Sub Command1_Click()
Dim Numero As Integer
Dim CalculoUno As Integer
DimRespuestaUno As Integer
Dim CalculoDos As Integer
Dim RespuestaDos As Integer
Numero = Text1
CalculoUno = Numero \ 100
RespuestaUno = Numero Mod 100
CalculoDos = RespuestaUno \ 10
RespuestaDos = RespuestaUno Mod 10
Text2 = RespuestaDos & CalculoDos & CalculoUno
End Sub
41-. Dados tres valores enteros, los cuales representan las longitudes de
los lados de un tringulo, escribir un programa que determine si el
tringulo es issceles, equiltero o escaleno.
47.- Disear un programa que permita leer un nmero e indique que mes
del ao corresponde a dicho nmero.
Private Sub CMDMESClick()
Dim A As String
A = TXT1.Text
If (A <= 12) Then
If (StrComp(A, "1") = 0) Then
MsgBox ("ENERO")
End If
If (StrComp(A, "2") = 0) Then
MsgBox ("FEBRERO")
End If
If (StrComp(A, "3") = 0) Then
MsgBox ("MARZO")
End If
If (StrComp(A, "4") = 0) Then
MsgBox ("ABRIL")
End If
If (StrComp(A, "5") = 0) Then
MsgBox ("MAYO")
End If
If (StrComp(A, "6") = 0) Then
MsgBox ("JUNIO")
End If
If (StrComp(A, "7") = 0) Then
MsgBox ("JULIO")
End If
If (StrComp(A, "8") = 0) Then
MsgBox ("AGOSTO")
End If
If (StrComp(A, "9") = 0) Then
MsgBox ("SEPTIEMBRE")
End If
If (StrComp(A, "10") = 0) Then
MsgBox ("OCTUBRE")
End If
If (StrComp(A, "11") = 0) Then
MsgBox ("NOVIEMBRE")
End If
If (StrComp(A, "12") = 0) Then
MsgBox ("DICIEMBRE")
End If
Else
MsgBox ("NO EXISTE EL MES")
End If
End Sub
48.- Disear un programa que permita leer un nmero e indique que da
de la semana corresponde a dicho nmero.
Dim A As String
Dim B As String
Dim A1 As String
Dim A2 As String
A = txtA.Text
A1 = "Javier"
B = txtB.Text
A2 = "Solis"
If (StrComp(A, A1) = 0) Then
MsgBox (" BIENBENIDO " & A)
Else
MsgBox ("USUARIO INCORECTO")
End If
End Sub
51.- Disear un programa que permita hallar la raz cuadrada de un
nmero ledo.
Private Sub cmdraiz_Click()
Dim b As Integer
Dim raiz As Integer
b = txtb.Text
raiz=(Sqr(b))
MsgBox (La raiz cuadrada es: & raz)
End Sub
52.- Disear un programa que permita leer un nmero y elevarlo a una
potencia.
Private Sub cmdpotencia_Click()
Dim A As Integer
Dim b As Integer
Dim pot As Integer
A = txtA.Text
b = InputBox(Ingrese la Potencia)
pot = (A^b)
MsgBox (El Resultado es: & pot)
End Sub
Dim A As Integer
Dim B As Integer
A = txtA.Text
B = txtB.Text
If (A > b) Then
MsgBox ("A ES MAYOR QUE B " & A)
End If
If (B > A) Then
MsgBox (" B ES MAYOR QUE A" & b)
End If
If (A = B) Then
MsgBox ("LOS NUMEROS SON IGUALES")
End If
End Sub
54.- Disear un programa que permita tranformar un nmero de grados a
radianes.
Private Sub cmdConvertir_Click()
Dim A As Integer
Dim RAD As Double
A = TXT1.Text
RAD = MsgBox("TU RESULTADO ES:" & ((A / 360) * 6.28))
End Sub
55.- Disear un programa que calcule la superficie de un triangulo en
funcin de la base y la altura.
Private Sub cmdcalcular_Click()
Dim a As Double
Dim b As Double
Dim sum As Double
a = InputBox("altura")
b = InputBox("base")
sup = (b * a)
MsgBox ("la superficie es:" & sup)
End Sub
56.- Disear un programa que permita leer un nmero en Km y muestre
la transformacin a m, m/min, m/s y m/cen.
Private Sub CMDCOMBERTIR_Click()
Dim a As Double
a = TXT1.Text
MsgBox ("metros: " & a * 1000)
MsgBox ("m/min: " & (a * 1000) / (60))
MsgBox ("m/s: " & ((a * 1000) / (60)) / (60))
MsgBox ("m/cen: " & (((a * 1000) / (60)) / (60)) / (100))
End Sub
57.- Disear un programa que permita hallar el rea y volumen de una
esfera.
Private SubcmdEsf_Click()
Dim R As Double
Dim V As Integer
Dim A As Integer
R=InputBox(Radio)
A=4*3.14*(R^2)
V=(4*3.14*(R^2))/3
If R>0 Then
lblA.caption=(El area es:& A)
lblV.caption=(El volumen es:& V)
Else
MsgBox(Ingrese radio )
End If
End Sub
58.-Disear un programa que permita hallar el rea y volumen de un
cubo.
Private SubcmdCub_Click()
Dim L As Double
Dim V As Double
Dim A As Double
L=InputBox(Lado)
A=12*L
V=L^3
If L>0 Then
lblA.caption=(El area es:& A)
lblV.caption=(El volumen es:& V)
Else
MsgBox(Ingrese Lado )
End If
End Sub
59.-Disear un programa que permita hallar el volumen de un tubo.
Private SubcmdTub_Click()
Dim R1 As Double
Dim R2 As Double
Dim H As Double
Dim V As Double
R1=InputBox(Radio 1)
R2=InputBox(Radio 2)
H=InputBox(Altura)
V=(2*3.14*H)*((R1+R2)/2)(R2-R1)
If R2>R1 Then
lblV.caption=(El volumen es:& V)
Else
MsgBox(Asegrese de introducir los radios respectivamente )
End If
End Sub
60.-Disear un programa que muestre el numero literal del 1 al 10
Private Subnumlit_Click()
Dim n As Integer
n=InputBox(Numero)
If (n>=1 And n<=10) Then
If n = 1 Then
MsgBox(Uno)
End If
If n = 2 Then
MsgBox(Dos)
End If
If n = 3 Then
MsgBox(Tres)
End If
If n = 4 Then
MsgBox(Cuatro)
End If
If n = 5 Then
MsgBox(Cinco)
End If
If n = 6 Then
MsgBox(Seis)
End If
If n = 7 Then
MsgBox(Siete)
End If
If n = 8 Then
MsgBox(Ocho)
End If
If n = 9 Then
MsgBox(Nueve)
End If
If n = 10 Then
MsgBox(Diez)
End If
Else
MsgBox(Ingrese nmero entre 1 y 10)
End If
End Sub