Dfd 5

6
EDHIEL MEDINA TELLO PROGRAMACION 2AM PROFESORA: MARGARITA ROMERO ALVARADO

Transcript of Dfd 5

Page 1: Dfd 5

EDHIEL MEDINA TELLO

PROGRAMACION 2AM

PROFESORA:

MARGARITA ROMERO ALVARADO

Page 2: Dfd 5

1.- Indicar si un alumno está aprobado calificación mayor o igual de 6 y

reprobado en caso

-Inicio

-Variables C: Numérico Entero

-Escribir “Indica la calificación”

-Leer C

-Si C es mayor de 6 entonces

-Escribir “Aprobado”

-Si C 5 entonces

-Escribir “Reprobado”

-Fin

Prueba de Escritorio

-Si C es igual a 8

-Escribir ‘’Aprobado’’

-Si C es igual a 5

-Escribir ‘’Reprobado’’

Page 3: Dfd 5

2.- En la compra de un pantalón si el precio es mayor de 100 hacer un

descuento de 20% y si vale menos de 100 pesos su descuento es de 10%

Inicio

Variables: P Numérico Entero

Si P es mayor a 100

Escribir “Descuento de 20%”

Si P es menor a 100

Escribir “Descuento de 10%”

Fin

PRUEBA DE ESCRITORIO

SI P es igual a 90

Escribir “Descuento de 10%”

Page 4: Dfd 5

3.-PROGRAMA QUE INDIQUE LA ENTRADA AL CINE SI LA PERSONA TIENE MAS

DE 18 AÑOS , EN CASO CONTRARIA SE LE NIEGA LA ENTRADA

Inicio

Variables: E Numérico Entero

Si E es mayor de 18

Escribir “entrada aceptada”

Si E es menor de 18

Escribir “entrada negada”

Fin

PRUUEBA DE ESCRITORIO

Si E es igual a 20

Escribir “entrada aceptada”

Page 5: Dfd 5

4.- EL SEÑOR AGUAYON VENDE MARISCOS Y TIENE 3 PROVEEDORES, EL

PRIMER PROVEEDOR LE OFRECE 100 KILOS DE CAMARON A $40.00 EL KILO, EL

SEGUNDO PROVEEDOR LE OFRECE 200 KILOS DE CAMARON A $60.00 EL KILO

Y EL TERCER PROVEEDOR LE OFRECE 150 KILOS DE CAMARON A $30.00 EL

KILO.

EL PROGRAMA DEBERA DE INDICAR CUAL DE TODOS LOS PROVEEDORES LE

OFRECE EL MEJOR PRECIO POR KILO AL SEÑOR AGUAYON, TOMANDO LAS

DECISIONES NECESARIAS PARA COMPARAR EL MEJOR DE TODOS.

Inicio

Variables: K, P ,P1,P2,P3 Numérico Entero

Escribir “indicar cuál de todos los proveedores le ofrece el mejor precio por

kilo al señor Aguayon”

P1=40P/100K= 0.4

P2=60P/200K=0.3

P3=30P/150K=0.2

Si P1 es menor que P2

Escribir “Mejor Precio”

Si P1 es menor que P3

Escribir “Mejor Precio”

Si P2 es menor que P3”

Escribir “Mejor Precio”

Fin

Page 6: Dfd 5

PRUEBA DE ESCRITORIO

Si 20 es menor que 10

Escribir “Mejor Precio”

Si 20 es menor que 30

Escribir “Mejor Precio”

Si 10 es menor que 30”

Escribir “Mejor Precio”

El mejor Precio es =$10

5.-EL SEÑOR CUMPLEAÑERO DESEA QUE REALICES UN PROGRAMA EN DONDE

LE MENCIONE CUANTOS DIAS TIENE CADA MES DE ESTE AÑO 2015, POR

EJEMPLO: SI DAS DE ENTRADA EL MES DE ENERO, EL PROGRAMA DEBERA DE

DECIRLE QUE TIENE 31 DIAS.

Inicio

Variables: M,D Numérico Entero

Escribir ”Cuantos días tienen los meses del año 2015”

FIN