-
Lenguaje
PSeInt (Pseudocódigo)
-
Descripción
Recopilar datos del cliente para la factura:
- CI
- Nombre
- Apellido
- Teléfono
- Correo
Comprar entradas al cine. Sólo si son 4 o más entradas aplicar un descuento según el tipo de transacción:
- Efectivo: aplica descuento 5%.
- Tarjeta: aplica un 3.5 % de descuento.
- Caso contrario no aplica descuento.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Proceso EntradasAlCine
Escribir Sin Saltar "Ingresa el CI:";
Leer CI;
Escribir Sin Saltar "Ingresa el Nombre:";
Leer Nombre;
Escribir Sin Saltar "Ingresa el Apellido:";
Leer Apellido;
Escribir Sin Saltar "Ingresa el Telefono:";
Leer Telefono;
Escribir Sin Saltar "Ingresa el Correo:";
Leer Correo;
Escribir Sin Saltar "Ingresa el valor de costo por entrada:";
Leer costo_por_entrada;
Escribir Sin Saltar "Ingresa el valor de entradas:";
Leer entradas;
descuento <- 0;
subtotal <- entradas*costo_por_entrada;
Escribir "Selecciona el valor de tipo de transaccion.";
Escribir " 1.- Efectivo";
Escribir " 2.- Tarjeta";
Escribir Sin Saltar " :";
Repetir
Leer tipo_de_transaccion;
Si tipo_de_transaccion<1 O tipo_de_transaccion>2 Entonces
Escribir Sin Saltar "Valor incorrecto. Ingrésalo nuevamente.: ";
FinSi
Hasta Que tipo_de_transaccion>=1 Y tipo_de_transaccion<=2;
Si entradas>=4 Y tipo_de_transaccion = 1 Entonces
descuento <- subtotal*0.05;
FinSi
Si entradas>=4 Y tipo_de_transaccion = 2 Entonces
descuento <- subtotal*0.035;
FinSi
total <- subtotal-descuento;
Escribir "CI: ", CI;
Escribir "Nombre: ", Nombre;
Escribir "Apellido: ", Apellido;
Escribir "Telefono: ", Telefono;
Escribir "Correo: ", Correo;
Escribir "Valor de descuento: ", descuento;
Escribir "Valor de subtotal: ", subtotal;
Escribir "Valor de total: ", total;
FinProceso
Escribir Sin Saltar "Ingresa el CI:";
Leer CI;
Escribir Sin Saltar "Ingresa el Nombre:";
Leer Nombre;
Escribir Sin Saltar "Ingresa el Apellido:";
Leer Apellido;
Escribir Sin Saltar "Ingresa el Telefono:";
Leer Telefono;
Escribir Sin Saltar "Ingresa el Correo:";
Leer Correo;
Escribir Sin Saltar "Ingresa el valor de costo por entrada:";
Leer costo_por_entrada;
Escribir Sin Saltar "Ingresa el valor de entradas:";
Leer entradas;
descuento <- 0;
subtotal <- entradas*costo_por_entrada;
Escribir "Selecciona el valor de tipo de transaccion.";
Escribir " 1.- Efectivo";
Escribir " 2.- Tarjeta";
Escribir Sin Saltar " :";
Repetir
Leer tipo_de_transaccion;
Si tipo_de_transaccion<1 O tipo_de_transaccion>2 Entonces
Escribir Sin Saltar "Valor incorrecto. Ingrésalo nuevamente.: ";
FinSi
Hasta Que tipo_de_transaccion>=1 Y tipo_de_transaccion<=2;
Si entradas>=4 Y tipo_de_transaccion = 1 Entonces
descuento <- subtotal*0.05;
FinSi
Si entradas>=4 Y tipo_de_transaccion = 2 Entonces
descuento <- subtotal*0.035;
FinSi
total <- subtotal-descuento;
Escribir "CI: ", CI;
Escribir "Nombre: ", Nombre;
Escribir "Apellido: ", Apellido;
Escribir "Telefono: ", Telefono;
Escribir "Correo: ", Correo;
Escribir "Valor de descuento: ", descuento;
Escribir "Valor de subtotal: ", subtotal;
Escribir "Valor de total: ", total;
FinProceso