Você está na página 1de 4

PROGRAMACIN Y ALGORTMICA

INTEGRANTES

_______________________________ _______________________________ _______________________________ COMPUTACIN E INFORMTICA. 111 MAANA MARCO TARAZONA PINEDO

ESPECIALIDAD: ALULA TURNO PROFESOR : : :

PROGRAMAS
1) Disear un programa que imprima 30 trminos de la siguiente serie: S=3, 8, 15,24, Sub Main() Dim x, y As Integer Console.Write("S = ") x = 3 For y = 5 To 63 Step 2 Console.Write("{0},", x) x = x + y Next End Sub

2) Imprima usando For anidados: 9: 8: 7: 6: 5: 4: ######### ######## ####### ###### ##### ####

Sub Main() Dim X, Y As Short For X = 9 To 4 Step -1 Console.Write("{0}:", X) For Y = 1 To X Console.Write("#") Next Console.WriteLine() Next End Sub

3) Imprima la Figura de nmero: 9876543210 876543210 76543210 6543210 543210 43210 3210 210 10 0 Sub Main() Dim X, Y As Short Console.WriteLine() For X = 9 To 0 Step -1 Console.Write(X) For Y = X - 1 To 0 Step -1 Console.Write(Y) Next Console.WriteLine() Next Console.WriteLine() End Sub 4) La Clave de un Telfono es 1234. Valide hasta tres intentos. Sub Main() Dim CLAVE, X As Integer Console.WriteLine(" USTED EST SIENDO MONITOREADO ") Console.WriteLine() Console.Write("PORFAVOR MARQUE LA CLAVE DE SU TELEFONO:") CLAVE = Console.ReadLine() For X = 1 To 1 If CLAVE <> 1234 Then Console.WriteLine(" CLAVE INCORRECTA!") Console.WriteLine() Console.Write("PORFAVOR MARQUE LA CLAVE DE SU TELEFONO:") CLAVE = Console.ReadLine() Console.WriteLine(" CLAVE INCORRECTA") Console.WriteLine() Console.Write("PORFAVOR MARQUE LA CLAVE DE SU TELEFONO:") CLAVE = Console.ReadLine() Console.WriteLine(" CLAVE INCORRECTA!") Console.WriteLine() Console.WriteLine(" LOS SENTIMOS ACCESO DENEGADO :( BYE BYE") Else Console.WriteLine() Console.WriteLine(" CLAVE CORRECTA,...BIENVENIDO") Console.WriteLine() End If Next Console.WriteLine() End Sub

5) Existe un juguete fallado, el cual cuando es encendido y puesto en operacin avanza inicialmente 5cm y se detiene. Y cada vez que se levanta y se ubica nuevamente en el suelo avanza el doble del espacio anterior. De acuerdo a lo expuesto, escribir un programa que ingrese el nmero de veces que se levantar el juguete y entonces mostrar el total de cuantos cm. avanzar ste. Sub Main() Dim LEVANTADAS, X, RECORRIDO, JUGUETE, LINEAS As Short Dim TOTAL As Short Console.WriteLine() Console.WriteLine(" EL JUGUETE FALLADO ") Console.WriteLine("_______________________________") Console.WriteLine() Console.WriteLine(" (^_^)") Console.WriteLine(" --[ ]--") Console.WriteLine(" _/ \_") Console.WriteLine() Console.Write("CUNTAS VECES SE LEVANT EL JUGUETE?:") LEVANTADAS = Console.ReadLine() Console.WriteLine() RECORRIDO = 5 TOTAL = 5 Console.WriteLine("ENTONCES ESTE FUE SU AVANCE:") Console.WriteLine() Console.WriteLine("-------------------------") Console.WriteLine("INICIALMENTE AVANZ 5Cm. ") For X = 1 To LEVANTADAS RECORRIDO = RECORRIDO * 2 TOTAL = TOTAL + RECORRIDO For JUGUETE = 1 To 1 Console.WriteLine() Console.WriteLine("------") Console.WriteLine("LUEGO: ") Console.WriteLine() Next Console.Write(" {0}Cm ", RECORRIDO) Next Console.WriteLine() Console.WriteLine("------------------------------------------") Console.WriteLine(" POR LO TANTO EL TOTAL QUE AVANZ ES:{0}Cm", TOTAL) Console.WriteLine(" LO QUE EQUIVALE A: {0} Mt.", TOTAL / 100) Console.WriteLine() Console.WriteLine() End Sub

Você também pode gostar