Está en la página 1de 3

Ejercicio 1 del pppt

tiempo_a = Val(InputBox("Ingrese tiempo en A"))


tiempo_b = Val(InputBox("Ingrese tiempo en B"))

velocidad = 50 / (tiempo_b - tiempo_a)

Print "Tiempo en A = "; tiempo_a


Print "Tiempo en B = "; tiempo_b
Print "Velocidad = "; velocidad
____________________________________________

Ejercicio 2 del ppt

lado_a = Val(InputBox("Ingrese lado en A"))


lado_b = Val(InputBox("Ingrese lado en B"))

hipotenusa = Sqr((lado_a) ^ 2 + (lado_b) ^ 2)

Print "Lados en A = "; lado_a


Print "lados en B = "; lado_b
Print "Hipotenusa = "; hipotenusa
_______________________________________________

Ejercicio 3 del ppt

nombre_pais = InputBox("Ingrese nombre del país")


superficie = Val(InputBox("Ingrese superficie"))
habitantes = Val(InputBox("Ingrese habitantes"))

densidad = habitantes / superficie

Print "país = "; nombre_pais


Print "superficie del país = "; superficie
Print "n° habitantes = "; habitantes
Print "densidad = "; densidad
Print nombre_pais; " tiene; una; densidad; de; "; densidad; "; habitantes; por;
km ^ 2; "
__________________________________________________________

Ejercico 4 del ppt

Alumno = InputBox("ingrese nombre del alumno")


preguntas = Val(InputBox("Ingrese cantidad de preguntas"))
correctas = Val(InputBox("Ingrese cantidad de correctas"))

porcentaje = correctas * 100 / preguntas

Print "Nombre = "; Alumno


Print "Cantidad de preguntas = "; preguntas
Print "Correctas = "; correctas
Print "Porcentaje = "; porcentaje
_____________________________________________________________

Ejercicio 9 del ppt

ciudad = InputBox("Ingrese ciudad tocopilla, mejillones o fin para terminar")


pasajes_t = 0
pasajes_m = 0
While ciudad <> "fin"

pasajes = InputBox("ingrese cantidad de pasajes")


If ciudad = "tocopilla" Then
pasajes_t = pasajes_t + pasajes

ElseIf ciudad = "mejillones" Then


pasajes_m = pasajes_m + pasajes

End If
ciudad = InputBox("Ingrese ciudad tocopilla, mejillones o fin para terminar")

total_pajes = pasajes_m + pasajes_t


Wend

Print "Total Tocopilla = "; pasajes_t


Print "Total Mejillones = "; pasajes_m
Print "Total pasajes = "; pasajes_t + pasajes_m

___________________________________________________________________________________
_

Cls
N1 = Val(InputBox("NOTA1"))
N2 = Val(InputBox("NOTA2"))
N3 = Val(InputBox("NOTA3"))

P = (N1 + N2 + N3) / 3

If P >= 4 Then

Print "APROBÓ. FELICITACIONES"

Else

Print "REPROBÓ. SIGA INTENTANDO"

End If
________________________________________________________________________________

x = 10
y = 80

suma = x + y

If suma < 100 Then


Print "Bajo el límite"
End If
End Sub
_______________________________________________________________________________

velocidad = 150
If velocidad < 150 Then
Print "Bajo el límite"
Else
Print "Sobre el límite"
End If
_____________________________________________________________________
edad = Val(InputBox("Ingrese edad"))
If edad < 15 Then
Print "Niño"
ElseIf edad < 25 Then
Print "Joven"
ElseIf edad < 65 Then
Print "Adulto"
Else
Print "Adulto Mayor"
End If
______________________________________________________________________________

LAC = Val(InputBox("Ingrese Lectura actual"))


LAN = Val(InputBox("Ingrese Lectura anterior"))

CM = LAC - LAN

If CM > 15 Then
Precio = 4500 + CM * 250
Print "Hay recargo de $4500"
Else
Precio = CM * 250
Print "No hay recargos"
End If

Print "Consumo ="; CM


Print "Precio ="; Precio
______________________________________________________________________________

i = 3
While i >= 0
Print i
i = i - 1

Wend
________________________________________________________________________________

n = Val(InputBox("Ingrese cantidad de números a promediar"))


Print "Se promediarán "; n; " números"
i = 1
suma = 0
While i <= n
x = Val(InputBox("Ingrese número"))
Print i; ")"; x
suma = suma + x
i = i + 1
Wend

promedio = suma / n
Print "El promedio es "; promedio

También podría gustarte