Está en la página 1de 7

UNIVERSIDAD DEL MAGDALENA

PROGRAMA DE INGENIERÍA ELECTRÓNICA


PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020

INDIQUE: CUÁL ES EL ENUNCIADO, QUÉ HACE CADA VARIABLE Y MEJORE LAS SALIDAS
DE DATOS.

1. INICIO
Escriba (“DIGITE LA CANTIDAD DE NÚMEROS”)
Lea ( t )
d  0 s1  0 c32  0
Para f = 1 , t haga
Escriba (‘ Digite un número” )
Lea ( n )
Si n MOD 3 = 0 y n MOD 2 = 0 entonces
c32  c32 + 1
cd  n ^ 2
Si ( cd < 1200 ) entonces
s1  s1 + n
dd+1
Fsi
Fsi
Fpara
Escriba ( ‘ El resultado es:’ , c32 )
p1 s1/d
Escriba (‘ El resultado final es:’ , p1)
FIN

2. INICIO
Escriba (“DIGITE LA CANTIDAD DE PRODUCTOS”)
Lea ( m )
sp  0 so  0 tp  0 to  0
Para w = 1 , m haga
Escriba (‘ Digite precio y tipo de producto : 1. Hogar 2. Víveres ’)
Lea ( pp , tpr )
Si ( tpr = 1 ) entonces
sp  sp + pp
tp  tp + 1
Fsi
Si ( tpr = 2 ) entonces
so  so + pp
to  to + 1
Fsi
Fpara

1
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020
prp  tp / m * 100
pro  to / m * 100
Escriba (“Los resultados son:”, prp,pro)
Si tp > to entonces
Escriba ( ‘ El valor 1 es mejor que el valor 2 y hay’, sp)
Fsi
Si to > tp entonces
Escriba ( ‘ El valor 2 es mejor que el valor 1 y hay ’ , so)
Fsi
Si to = tp entonces
Escriba ( ‘ Los valores 1 y 2 son mejores’)
Fsi
FIN

3. INICIO
Escriba (“DIGITE LA CANTIDAD DE VALORES”)
Lea ( a )
r  0 sr  0
Para g = 1 , a haga
Escriba (‘ Digite un número’)
Lea ( b )
r3  b ^ (1 / 3)
Escriba ( ‘ El valor de ‘ , b, ‘es’ , r3)
Si ( r3 > = 7 ) entonces
r r+1
sr  sr + r3
Fsi
Fpara
pr3  sr / r
Escriba ( ‘ El resultado 1 es’ , r )
Escriba (‘ El resultado total es:’ , pr3)
FIN

4. INICIO
Escriba (“DIGITE LA CANTIDAD DE ESTUDIANTES”)
Lea ( cest )
vu  0 et  0 pr  0 snvu  0 snet  0 snpr  0
Para c = 1 , cest haga
Escriba (“ Digite las notas de vida universitaria, ética y programación” )
Lea ( nvu, net, npr )

2
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020
Si nvu > = 300 entonces
snvu  snvu + nvu
vu  vu + 1
Fsi
Si net > = 300 entonces
snet  snet + net
et et + 1
Fsi
Si npr > = 300 entonces
snpr  snpr + npr
pr  pr + 1
Fsi
Fpara
pvu  snvu / vu pet  snet / et ppr  snpr / pr
Escriba ( ‘ El valor 1 es : ’ , vu )
Escriba ( ‘ El valor 2 es : ’ , et )
Escriba ( ‘ El valor 3 es : ’ , pr )
Escriba (‘ El resultado 1 es :’ , pvu, ‘ el 2 es ‘ , pet , ‘ y el 3 es : ‘, ppr)
FIN

5. INICIO
Escriba (“DIGITA LA CANTIDAD DE VALORES”)
Lea ( h )
c5  0 s4  0 c4  0
Para n = 1 , h haga
Escriba (“Digite un valor”)
Lea ( vl )
Si (vl > 0) y (vl mod 5 = 0) entonces
cp5  cp 5 + 1
r4  vl ^ (1/4)
s4  s4 + r4
c4  c4 + 1
Si (r4 < 5) entonces
c5  c5 + 1
Fsi
Fsi
Fpara
p4  s4 / c4
Escriba (“El resultado es “ , p4 )
Escriba (“El valor 1 es “ , cp5 )
Escriba (“El valor 2 es “ , c5)
FIN

3
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020

6. INICIO
Escriba (“DIGITE LA CANTIDAD DE NÚMEROS”)
Lea ( n )
cp  0 sp  0 ci  0 si  0
Para a = 1 , n haga
Escriba (“Digite un número”)
Lea ( num )
Si (num mod 2= 0) entonces
sp sp + num ^ 3
cp  cp + 1
Fsi
Si (num mod 2 <> 0) entonces
si  si + num ^ 3
ci  ci + 1
Fsi
Fpara
Si (sp > si) entonces
pp  sp/cp
Escriba (“ Es más del 1 y el resultado 1 es “ , pp )
Fsi
Si (si > sp) entonces
pi  si/ci
Escriba (“ Es más del 2 y el resultado 2 es “ , pi )
Fsi
FIN

7. INICIO

Escriba ( “ Digite la cantidad de cd’s “)


Lea ( cc )
cs  0 cv  0 ss 0 sv  0
Para p = 1, cc haga
Escriba ( “ Digite el tipo de música: 1. Salsa 2. Vallenato “)
Lea ( tm )
Escriba ( “ Digite el precio“)
Lea ( pcd )
Si tm = 1 entonces
cs  cs + 1
ds  pcd *0.08
ss  ss + ds

4
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020
sino
c2  c2 + 1
dv  pcd * 0.12
sv  sv + dv
Fsi
Fpara
ps  cs/cc * 100 pv  cv/cc * 100
Escriba (“ El resultado 1 es “, ps, “ y el 2 es “, pv)
Si cs> cv entonces
Escriba ( “Hay más del 1 es: “ , ss, “ y es” , cs )
Fsi

Si cv > cs entonces
Escriba ( “Hat mas del 2 es: “ , sv , “ y es “, cv )
Fsi
FIN

8. INICIO

Escriba (“DIGITE LA CANTIDAD DE CLIENTES DEL CAFE INTERNET”)


Lea ( ccl )
t1  0 t2  0 t3  0 r  0 cm  0 cm1  0 ch  0 ch1  0
Para b = 1 , ccl haga
Escriba (‘ Digite el tipo de servicio: 1. Consulta 2. Chatear 3.Email”)
Lea ( ts )
Escriba (‘ Digite el tiempo: 1. hasta 1 hora 2. 1 a 2 horas 3. Mas de 2 horas ’ )
Lea ( t )
Escriba (‘Servicios Extras: 1. Cámara 2. Micrófono-Audífono “)
Lea ( se )
Escriba (‘Ingrese el sexo: 1. Mujer 2. Hombre “)
Lea ( sx )
Escriba (‘ Digite el valor del servicio’ )
Lea ( vs )
Si ts = 1 entonces
t1  t1 +1
Fsi
Si ts = 2 entonces
t2  t2 +1
Fsi
Si ts = 3 entonces
t3  t3 +1
Fsi

5
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020
Si ts = 3 y t = 3 y se = 1 y vs > 5000 entonces
r r+1
Fsi
Si sx = 1 y ts = 2 entonces
cm  cm + 1
Si t = 1 y se= 1 entonces
cm1  cm1 + 1
Fsi
Fsi
Si sx = 2 y ts = 2 entonces
ch  ch + 1
Si t = 2 y se = 2 entonces
ch1  ch1 + 1
Fsi
Fsi
Fpara
p1  t1/ccl * 100 p2  t2/ccl * 100 p3  t3/ccl * 100
Escriba ( “ El valor 1 es “ , p1, “el 2 es “ , p2, “ y el 3 es “, p3 )
Escriba ( “ El valor 4 es “ , r )
Si cm > ch entonces
Escriba (“ Hay más del 1 siendo “ ,cm, “ y son “ , cm1)
Fsi
Si ch > cm entonces
Escriba (“ Hay más del 2 siendo “ ,ch, “ y son “ , ch1)
Fsi
FIN

9. INICIO
Escriba (“Ingrese la cantidad de conductores”)
Lea (cc)
ce  0 ca  0 cm  0 sm  0 ch  0 sh  0
PARA h=1,cc,1 haga
Escriba (“Ingrese el tipo de auto: 1. Particular 2. Comercial”)
Lea (tc)
Escriba (“Ingrese modelo del auto”)
Lea (ma)
Escriba (“Ingrese origen de la matrícula: 1.Nacional 2. Local 3. Extranjera”)
Lea (mat)
Escriba (“Ingrese sexo del conductor: 1. Mujer 2. Hombre”)
Lea (sc)
Escriba (“Ingrese valor del peaje”)
Lea (vp)

6
UNIVERSIDAD DEL MAGDALENA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
PROGRAMACIÓN I
GUÍA DE EJERCICIOS - ALGORITMOS CONSTRUIDOS
NOVIEMBRE 17 DE 2020

Si sc = 1 y ma >= 2005 y ma <= 2010 y mat = 2 y vp >= 15000 entonces


ca  ca + 1
Fsi
Si mat = 3 y tc = 2 entonces
ce  ce + 1
Fsi
Si tc = 1 y sc = 1 y mat = 1 entonces
cm  cm + 1
sm  sm + vp
Fsi
Si tc = 1 y sc = 2 y mat = 1 entonces
ch  ch + 1
sh  sh + vp
Fsi
FPARA
Escriba (“El resultado 1 es”, ca)
pe  ce * 100/cc
Escriba (“El resultado 2 es”, pe)
Si cm > ch entonces
pm  sm/cm
Escriba (“Hay más del 1 y el resultado total 1 es”, pm)
Fsi
Si ch > cm entonces
ph  sh/ch
Escriba (“Hay más del 2 y el resultado total 2 es”, ph)
Fsi
FIN

También podría gustarte