You are on page 1of 8

EJERCICIOS DE ESTRUCTURA DE

REPETICIN
1.
INICIO
cont = n
Num1, Num3, Num5....,suma=entero
leer num1,num3
suma=num1+num3
si cont. menor a N hacer
fin para
fin para
FIN

2.
1. Leemos N, supongamos N=4.
2. Ns2? NO
3. A=1
4. B=1
5. C=A+B=1+1=2
6. A=B=1
7. B=C=2
8. N=N-1=4-1=3
9. N=2? NO (5) C=A+B=1+2=3
10.A=B=2 (7) B=C=3 (8) N=N-1=3-1=2 (9) N=2? SI
11.) Escribimos B, es decir 3.

3.
4.
1Proceso Factorial
2 Escribir "Ingrese un numero para obtener su factorial:"
3 Leer numero
4 x <- 1
5 Para i <- numero hasta 1 Hacer
6 Escribir sin saltar i, "*";
7 x <- x * i
8 FinPara
9 Escribir "El factorial es: ", x;
10Finproceso

5.
Proceso DecimalBinario
Leer decimal
binario 0
i0
Mientras decimal > 0
digito decimal mod 2
decimal trunc(decimal / 2)
binario binario + digito * 10^i
ii+1
FinMientras
Escribir binario
FinProceso

6.
7.
(1) Leer N N=4
(2) Leer M M=2
(3) I=N-1=3
(4) Leer A A=3 (5) A>M? SI (6) M=A=3
(7) I=I-1=3-I=2
(8) I=0? NO (4) Leer A A=-1

8.
proceso sumatoria _de _ numeros _pares
escribir bienbenido
escribir programa que calcule la sumatoria de los multiplos de 5 hasta100
escribir los numeros son
N<-0
SUMA <-0
MIENTRAS N <=50 HACER
N<- N +1
M<-N*2
SUMAR< SUMAR +M
ESCRIBIE M
FINMIENTRAS
ESCRIBIR EL RESULTADO ES
ESCRIBIR LA SUMA
FINPROCESO

9.
10.
1.Inicio
2.Leer N
3.Hacer A = 0, B = 0, C = 0
4.Hacer T1 = 0, T2 = 0, T3 = 0
5.Hacer TT = 0
6.Hacer CN = 1
7.Mientras CN < = N
Leer V
Si V > 1000
Entonces
Hacer A = A + 1
Hacer T1 = T1 + 1
Si no
Si V > 500
Entonces
Hacer B = B + 1
Hacer T2 = T2 + 1
Si no
Hacer C = C + 1
Hacer T3 = T3 * 1
Fin compara
Fin compara
Hacer TT = TT + V
Hacer CN = CN + 1
Fin mientras
8.Escribir Las ventas y el total de ventas 1 es:, A, T1
9.Escribir Las ventas y el total de ventas 2 es:, B, T2
10.Escribir Las ventas y el total de ventas 3 es:, C, T3
11.Escribir El total de ventas es:, TT
12.Fin

11.
1.Inicio
2.Hacer P = 5.0
3.Desde I = 1 hasta I = 20
Hacer P = P * 2
Escribir El pago mensual, P
Hacer T = T + P
Fin desde
4.Escribir Pago total, T
5.Fin

12.
1. Inicio
2.Leer N, TI, TP
3.Si TI = Sencilla
Entonces
Hacer PA = 20.00
Si no
Si TI = Doble
Entonces
Hacer PA = 25.00
Si no
Hacer PA = 28.00
Fin compara
Fin de compara
4.Hacer TO = PA * N
5.Si TP = Tarjeta
Entonces
Hacer CA = TO * 0.05
Si no
Hacer CA = 0
Fin compara
6.Hacer TOT = TO + CA
7.Escribir La hamburguesa cost, PA
8.Escribir El total sin cargo, TO
9.Escribir El cargo es, CA
10.Escribir El total por pagar es, TOT
11.Fin

13.

14.
15.

16.

17.

18.
19.

20.

You might also like