// --- ENTRADA INICIAL ---
Leer cantidad_articulos
total = 0
// --- BUCLE: se repite por cada artículo ---
Para i desde 1 hasta cantidad_articulos
Leer nombre_articulo
Leer precio_articulo
total = total + precio_articulo
Fin Para
// --- PREGUNTA FINAL ---
Leer cliente_registrado (verdadero / falso)
// --- PROCESO: descuento ---
Si cliente_registrado == verdadero
descuento = total * 0.10
total_final = total - descuento
Sino
total_final = total
// --- SALIDA ---
Mostrar "Total a pagar: $", total_final
Paso 3. Diagrama de flujo
[INICIO]
|
Leer: cantidad_articulos
total = 0
i = 1
|
▼
¿i <= cantidad_articulos?
/ \
SÍ NO
| |
Leer nombre_articulo |
Leer precio_articulo |
total = total + |
precio_articulo |
i = i + 1 |
\ |
▼ |
(vuelve arriba) |
▼
Leer: cliente_registrado
|
▼
¿cliente_registrado == verdadero?
/
SÍ NO
| |
descuento = total * 0.10 total_final = total
total_final = total -
descuento
| |
\ /
▼
Mostrar "Total: $", total_final
|
[FIN]