martes, 26 de febrero de 2013

ALGORITMOS 6


26._LEER 10 NUMEROS Y OBTENER SU CUBO

“Análisis”
   Entrada: numero (a)
Salida: total (t)

“Pseudocódigo”
<!--[if !supportLists]-->1.       <!--[endif]-->Inicio
<!--[if !supportLists]-->2.       <!--[endif]-->Suma=0 ci=1   cf=n
<!--[if !supportLists]-->3.       <!--[endif]-->Hacer ci+ cf=a     ci=1 a 10
Leer números
Sum= sum+ sum
Ci=ci+1
Fin para
<!--[if !supportLists]-->4.       <!--[endif]-->Cubo=suma*suma*suma
<!--[if !supportLists]-->5.       <!--[endif]-->Fin




27._AL CERRAR UN EXPENDIO DE NARANJAS 15 CLIENTES QUE AUN NO HAN PAGADO RECIBIRÁN UN 15 % DE DESCUENTO SI COMPRAN MÁS DE 10 KG. DETERMINAR CUÁNTO PAGARA CADA CLIENTE Y CUANTO RECIBIRÁ LA TIENDA.

“Análisis”
       Entrada: numero de compra (nc):
          Salida: pago de cliente (pg)
           Recibirá tienda (rt)

“Pseudocódigo”
<!--[if !supportLists]-->1.       <!--[endif]-->Inicio
<!--[if !supportLists]-->2.       <!--[endif]-->Suma=0
C1=1
Cf=15
<!--[if !supportLists]-->3.       <!--[endif]-->Hacer para c1=1-15
<!--[if !supportLists]-->4.       <!--[endif]-->Leer nc
Nc > 10
Cl =cl+0
<!--[if !supportLists]-->5.       <!--[endif]-->Fin




28._OBTENER EL PROMEDIO DE CALIFICACIONES DE UN GRUPO DE N PERSONAS

“Análisis”
Entrada: número de alumnos (na)
Salida: promedio total (pt)


“Pseudocódigo”
<!--[if !supportLists]-->1.       <!--[endif]-->Inicio
<!--[if !supportLists]-->2.       <!--[endif]-->Leer Na
<!--[if !supportLists]-->3.       <!--[endif]-->Mientras g≤ Na
G=g+1
Leer n
CE=ce+ 1
P=Ce/n
<!--[if !supportLists]-->4.       <!--[endif]-->Mostrar ce, p
<!--[if !supportLists]-->5.       <!--[endif]-->Fin mientras
<!--[if !supportLists]-->6.       <!--[endif]-->Fin






29._ REALIZAR UN ALGORITMO QUE CALCULE LA EDAD DE UNA PERSONA.

“Análisis”
    Entrada: año actual (a_a)                        salida: edad
                    Año de nacimiento (a_n)


“Pseudocódigo”
  
<!--[if !supportLists]-->1.       <!--[endif]-->Inicio
<!--[if !supportLists]-->2.       <!--[endif]-->Conocer año actual y fecha de nacimiento
<!--[if !supportLists]-->3.       <!--[endif]-->Ejecutar la operación (a_a-a_n)=edad
<!--[if !supportLists]-->4.       <!--[endif]-->Mostrar resultado
<!--[if !supportLists]-->5.       <!--[endif]-->Fin



30._LEER 10 NUMEROS E IMPRIMIR SOLAMENTE LOS NUMEROS POSITIVOS

“Análisis”
    Entrada: número inicial y final (ni, nf)
Salida: números positivos (np)

“Pseudocódigo”

<!--[if !supportLists]-->1.       <!--[endif]-->Inicio
<!--[if !supportLists]-->2.       <!--[endif]-->Suma=0
Ni= 1
Nf= 10
Hacer para ci=1 a 10
<!--[if !supportLists]-->3.       <!--[endif]-->Leer numero
If núm.>0 htem
Imprimir número
<!--[if !supportLists]-->4.       <!--[endif]-->End if
<!--[if !supportLists]-->5.       <!--[endif]-->End for
<!--[if !supportLists]-->6.       <!--[endif]-->Fin






No hay comentarios:

Publicar un comentario