Click here to load reader
View
215
Download
0
Embed Size (px)
Citation preview
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 1/7
ALUMNO: GUTIERREZ ALVARADO JUAN MANUEL
CÓDIGO: 15190286
PRÁCTICA DOMICILIARIA 4
1. Di!"! #$ %&'()i*+( ,#! -%&-#&! +#!*)! &(/ii()! /! #$ $+!)( &!/( /!& *!-&%/(
3(&:
INICIO
//i= número de divisores de un número ingresado
//n=número ingresado
Entero n,i;
Escribir “Introducir un número: “;
Leer n;
Para i=1 hasta n incrementar i+1
Si ni = ! entonces Escribir i
"in#Si
"in#Para
FIN
2. Di!"! #$ %&'()i*+( ,#! -%&-#&! +#!*)! &(
/ii()! /! #$ $+!)( &!/( /!& *!-&%/( !)i-%) i !& $+!)( ! )i+(
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 2/7
3(&:
INICIO
//i= número de divisores de un número ingresado
//n=número ingresado
Entero n,i;
Escribir “Introducir un número: “;
Leer n;
Para i=1 hasta n incrementar i+1
Si ni = ! entonces
Escribir i
"in#Si
"in#Para
Escribir “Introducir un número: “;
Leer n;
Para i=1 hasta n
Si n i = ! entonces
Escribir i
$ = $+1
"in si
"in Para
Leer n
Si $ %= &
Escribir “E' número “,n,( no es $rimo(;
Si#no Escribir “E' número (,n,( si es $rimo(;
"in si
IN
7. Di!"! #$ %&'()i*+( ,#! -%&-#&! +#!*)! &% #+%/! 5 $+!)( &!/( /!& *!-&%/(.
3(&:
INICIO
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 3/7
Entero i, )um
*har seguir
acer
Entero suma = !
Para i=! hasta i=- incrementar i+1
Escribir .Introduce e' numero: .
Leer )um
suma=suma+)um
"in#Para
Escribir .La suma tota' es ., suma
Escribir .0uieres vo'ver a em$ear2 S/).
Leer seguir
3ientras 4seguir%=.n. 5 seguir%=.). 5 seguir%=.s. 5 seguir%=.S.6
acer
Escribir .7ienes 8ue escribir S o )9.
Leer seguir
"in 3ientras
3ientras4seguir = .s. o seguir = .S.6
"in#acer3ientras
IN
5. Di!"! #$ %&'()i*+( ,#! !)+i*% -%&-#&%) &% #+%/! &( )i+!)( N *)+i$( /! &% i'#i!$*! !)i!:
2 4 12 48 240
3(&:
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 4/7
I)I*I
Entero a=&, i=1, acum=!, b, n
Escribe “Ingrese numero: (
Lee n
acer
b=ai
a=b
Escribe b,“ + (
acum=acum+b
i=i+1
3ientras 4i=n6
"in#acer3ientras
Escribe “La suma es: (, acum
"I)
6. A& $%& /! #$ -#)( ! /!!% %;!) -#<& =% i/( !&%&#+$( -($ &% +!>() $(*% )(+!/i(. 3! %;! ,#!!*! %"( !$*)%)($ ?5 %&#+$( ,#! *(/( *i!$!$ 7%i'$%*#)%. D%) !& $(+;)! &% $(*% +!/i%.
3(&:
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 5/7
INICIO
Entero i=!
<ea' $, n1, n&, n
*aracter nombre>!?, ma5>!?, e>1?
acer
Escribir “Ingresar e' nombre de' a'umno:(
Leer nombre
Escribir “Ingresar sus tres notas:(
Leer n1,n&,n
$=4n1+n&+n6/
Escribir “E' $romedio de' a'umno es:(,$;
ma5or=$;
nombre=ma5
Si $@=ma5or
"in#Si
i=i+1
3ientras iA-
"in acer#3ientras
Escribir “E' a'umno(, ma5,(obtiene e' ma5or $romediocon:(,ma5or
IN
8. 3! =% !&!--i($%/( N $+!)( /! !)($% %)% )!%&i@%)#$% !$-#!*% !$ #$ )(-!( )!!*i*i( ! i$')!% !& ')%/( /!i$*)#--i$ &% !/%/ /! -%/% !)($%.
Di!"! #$ %&'()i*+( ,#! +#!*)! !& )(+!/i( /! !/%/!B &%+%() !/%/ !& ()-!$*%>! /! !)($% -($ i$*)#--i$
P)i+%)i%B 3!-#$/%)i% 3#!)i().3OL:
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 6/7
INICIO
Entero i, ma5or, cont1, cont&, con = !
Entero edad
<ea' $e, $1, $&, $, ae=!, n*har grado
Escribir “Ingrese e' número de $ersonas a ingresar: (
Leer n
acer
Escribir “I)B<ESE LC EDCD DE LC PE<S)C: (
Leer edad
Escribir “I)B<ESE EL B<CD DE I)S7<**I): P<I3C<IC 4P6,SE*)DC<IC 4S6, SPE<I< 46(
Leer grado
ae = ae+edad
Si 4ma5or=edad6
ma5or=edad
"in#Si
Segun 4grado6 hacer
*aso P : cont1 = cont1+1
*aso S : cont& = cont&+1
*aso : cont = cont+1
"in#Segun
I=i+1
3ientras 4in6
"in#acer3ientras
$e=ae/n
$1=4cont1/n6
$&=4cont&/n6
$=4cont/n6
7/23/2019 Practica 4 Desarrollo
http://slidepdf.com/reader/full/practica-4-desarrollo 7/7
Escribir “EL P<*E)7CFE DE PE<S)CS *) I)S7<**I) P<I3C<ICES:(, $1,((
Escribir “EL P<*E)7CFE DE PE<S)CS *) I)S7<**I)SE*)DC<IC ES:(, $&,((
Escribir “EL P<*E)7CFE DE PE<S)CS *) I)S7<**I) SPE<I<ES:(, $,((
Escribir “EL P<3EDI DE EDCDES ES: .,$e
Escribir “LC EDCD 3CG< ES: .,ma5or
IN