Professional Documents
Culture Documents
ESTRUCTURAS SECUENCIALES
1. Dados los enunciados siguientes desarrollar el algoritmo y diagrama
de flujo correspondiente a cada ejercicio propuesto, utilizando
estructuras secuenciales.
Proceso sin_titulo
definir suma, n Como Entero
suma<-0
escribir "introducir un numero:"
leer n
suma =(n*(n+1))/2
mostrar "el resultaado de la suma es:", suma
FinProceso
Proceso sin_titulo
definir suma, n Como Entero
suma<-0
escribir "introducir un numero:"
leer n
suma = n*(n+1)*(2*n+1)/6
mostrar "el resultaado de la suma es:", suma;
FinProceso
Proceso sin_titulo
definir d1, d2, area_del_rombo Como
Entero
area_del_rombo<-0
escribir "escribir diagonal 1 :"
leer d1
escribir "escribir diagonal 2 :"
leer d2
area_del_rombo=d1*d2/2
mostrar "el area del rombo conocido es:",
area_del_rombo
FinProceso
Proceso sin_titulo
definir c,t,n,m Como Real
m=0.0
mostrar "ingrese su capital inicial:"
leer c
mostrar "ingrese su tasa de interes:"
leer t
mostrar "durante cuanto tiempo:"
leer n
m=c*(1+t)^n
mostrar "el monto a pagar es:",m
FinProceso
Proceso sin_titulo
definir nota1,nota2,nota3,nota4,
notamenor Como Entero
definir promedio Como Real
Mostrar "ingresar la nota 1:"
leer nota1
Mostrar "ingresar la nota 2:"
leer nota2
Mostrar "ingresar la nota 3:"
leer nota3
Mostrar "ingresar la nota 4:"
leer nota4
Si (nota1<nota2 && nota1<nota3 &&
nota1<nota4) Entonces
notamenor=nota1
Fin Si
Si (nota2<nota1 && nota2<nota3 &&
nota2<nota4) Entonces
notamenor=nota2
Fin Si
Si (nota3<nota1 && nota3<nota2 &&
nota3<nota4) Entonces
notamenor=nota3
Fin Si
Si (nota4<nota1 && nota4<nota2 &&
nota4<nota3) Entonces
notamenor=nota4
Fin Si
promedio=(nota1+nota2+nota3+nota4notamenor)/3
mostrar "el promedio es de:",promedio
FinProceso
Proceso sin_titulo
definir a,b,c Como Entero
mostrar "ingrese valor de a:"
leer a
mostrar "ingrese valor de b:"
leer b
c=a
a=b
b=c
mostrar " los datos estan invertidos:"
mostrar "a=",a
mostrar "b=",b
FinProceso
A= S( S A )( SB )( SC)
Proceso sin_titulo
definir a,b,c Como Entero
definir area,s como real
mostrar "ingresar lado a"
leer a
mostrar "ingresar lado b"
leer b
mostrar "ingresar lado c"
leer c
s=(a+b+c)/2
mostrar "el semiperimetro es:",s
area=rc(S*(S-A)*(S-B)*(S-C))
mostrar "el area del triangulo es :",area
FinProceso
i)
Juan hace unos das visito una tienda para averiguar sobre el
precio de un producto, hoy da Juan se acerc a la tienda para
comprar el producto, pero se da con la sorpresa que precio se
ha incrementado. Desarrollar un algoritmo y diagrama de
flujo que permita ingresar el precio anterior y el precio actual
de un producto; calcular y mostrar el alza en soles y el alza en
porcentaje de dicho producto.
Proceso sin_titulo
//i.
Juan hace unos das visito una tienda para
//averiguar sobre el precio de un producto, hoy da
Juan
//se acerc a la tienda para comprar el producto,
pero se da
//con la sorpresa que precio se ha incrementado.
Desarrollar un
//algoritmo y diagrama de flujo que permita
ingresar el precio
//anterior y el precio actual de un producto; calcular
y mostrar
//el alza en soles y el alza en porcentaje de dicho
producto.
definir p_antes,p_despues,alza Como real
definir porcentaje como real
mostrar "ingresar el precio anterior del producto:"
leer p_antes
mostrar "ingresar el precio despues del producto:"
leer p_despues
alza=p_despues-p_antes
mostrar "el alza es de :",alza
porcentaje=alza*100/p_antes
mostrar "el porcentaje es de :",porcentaje
FinProceso
j) Calcular el salario que recibir un trabajador, si se conoce el
nmero de horas trabajadas y el pago que recibe por hora.
Considere adems que por concepto de AFP se le descuenta
el 12.3%
Proceso sin_titulo
definir hora,pago_horas Como Entero
definir subtotal, total,descuento como real
mostrar "horas trabajadas:"
leer hora
mostrar "pago por horas:"
leer pago_horas
subtotal=hora*pago_horas
descuento=subtotal*0.123
total=subtotal-descuento
mostrar "el total a pagar por empleado es:",total
FinProceso
ESTRUCTURAS
CONDICIONALES
Proceso sin_titulo
definir largo,ancho,pago, terreno, subtotal Como Entero
definir descuento, total_pago Como Real
mostrar "ingrese el largo del terreno:"
leer largo
mostrar "ingrese el ancho del terreno:"
leer ancho
terreno=ancho*largo
mostrar "pago por metro cuadrado:"
leer pago
subtotal=terreno*pago
Si (terreno>400) Entonces
descuento=subtotal*0.1
total=subtotal-descuento
Fin Si
total=subtotal
mostrar "el precio por el terreno sera:",total
FinProceso
Proceso sin_titulo
definir nota Como Entero
Definir descuento como real
mostrar "ingresar nota:"
leer nota
si(nota<5)
nota=nota +3
mostrar "nota modificada:",nota
FinSi
si(nota>=5 y nota<10)
nota=nota +2
mostrar "nota modificada:",nota
FinSi
si(nota>=10 y nota<15)
nota=nota +1
mostrar "nota modificada:",nota
FinSi
si(nota>=15 y nota<=20)
descuento=notaMOD5
nota=nota-descuento
mostrar "nota
modificada:",nota
FinSi
FinProceso
Ingresar
e)
cuatro
notas
obtener
promedio
y
el
de
Proceso sin_titulo
leer precio
subtotal=articulos*precio
si(articulos>=100)
descuento= subtotal*0.4
total=subtotal-descuento
FinSi
si(articulos>=25 y articulos<100)
descuento= subtotal*0.2
total=subtotal-descuento
FinSi
si(articulos>=10 y articulos<25)
descuento= subtotal*0.1
total=subtotal-descuento
FinSi
si(articulo<10)
total=subtotal
FinSi
mostrar "debemos pagar :",total,
" ", "$"
FinProceso
i)
Proceso sin_titulo
definir num Como Entero
mostrar "ingresar
numeros del [1-5]:"
leer num
si(num==1)
mostrar "la
es:","","A"
FinSi
si(num==2)
mostrar "la
es:","","E"
FinSi
si(num==3)
mostrar "la
es:","","I"
FinSi
si(num==4)
mostrar "la
es:","","O"
FinSi
si(num==5)
mostrar "la
es:","","U"
FinSi
vocal
vocal
vocal
vocal
vocal
FinProceso
Proceso sin_titulo
definir num Como Entero
mostrar "ingresar
leer num
si(num==1)
mostrar "la
FinSi
si(num==2)
mostrar "la
FinSi
si(num==3)
mostrar "la
FinSi
si(num==4)
mostrar "la
FinSi
si(num==5)
mostrar "la
FinSi
si(num==6)
mostrar
FinSi
si(num==7)
mostrar
FinSi
si(num==8)
mostrar
FinSi
si(num==9)
mostrar
FinSi
si(num==10)
mostrar
FinSi
si(num==11)
mostrar
FinSi
si(num==12)
mostrar
FinSi
FinProceso
Carrera
Puntaje
Profesional
Mnimo
Sistemas
100
Electrnica
90
Industrial
80
Administracin
70
Proceso sin_titulo
definir puntaje Como Entero
mostrar "ingresar puntaje obtenido:"
leer puntaje
si(puntaje<=120 y puntaje>=100)
mostrar "ingreso a la carrera de:", " ", "sistemas"
FinSi
si(puntaje<100 y puntaje>=90)
mostrar "ingreso a la carrera de:", " ", "Sistemas y Electrnica"
FinSi
si(puntaje<90 y puntaje>=80)
mostrar "ingreso a la carrera de:", " ", "Sistemas , Electrnica y
Industrial"
FinSi
si(puntaje<80 y puntaje>=70)
mostrar "ingreso a la carrera de:", " ", "Sistemas
,Electrnica,Industrial y Administracin"
FinSi
si(puntaje<=120 y puntaje<70)
mostrar "NO ALCANZO EL PUNTAJE REQUERIDO"
FinSi
FinProceso
l)
Dada la
edad de
una
persona
determine
qu etapa
del
desarrollo
en
se
encuentra.
Etapa
Edad
Infancia
Niez
Adolescencia
Juventud
Adultez
Senectud
De 61 aos a ms
Proceso sin_titulo
definir edad Como Entero
es :","INFANCIA"
es :","NIEZ"
es :","ADOLESCENCIA"
es :","JUVENTUD"
FinSi
si(puntaje<80 y puntaje>=70)
mostrar "ingreso a la carrera
,Electrnica,Industrial y Administracin"
de:",
"
FinSi
si(puntaje<=120 y puntaje<70)
mostrar "NO ALCANZO EL PUNTAJE REQUERIDO"
",
"Sistemas
Proceso sin_titulo
definir nota Como Entero
Definir descuento como real
mostrar "ingresar nota:"
leer nota
si(nota<5)
nota=nota +3
mostrar "nota
modificada:",nota
FinSi
si(nota>=5 y nota<10)
nota=nota +2
mostrar "nota
modificada:",nota
FinSi
si(nota>=10 y nota<15)
nota=nota +1
mostrar "nota
modificada:",nota
FinSi
si(nota>=15 y nota<=20)
descuento=notaMOD5
nota=nota-descuento
mostrar "nota
modificada:",nota
FinSi
FinProceso
Estructura Repetitivas
Proceso sin_titulo
definir suma,n Como Entero
suma=0
mostrar "ingresar un numero:"
leer n
Para i<-0 Hasta n Con Paso 1 Hacer
suma<-suma+i
Fin Para
mostrar "el resultado de la suma
es:",suma
FinProceso
Proceso sin_titulo
definir n Como Entero
mostrar "ingresar numero:"
leer n
Si (n>=0) Entonces
Para i<-0 Hasta n Con Paso 1
Hacer
mostrar "numero al
reves:",n-i
Fin Para
Fin Si
FinProceso
Proceso sin_titulo
definir num como entero
Para i<-10 Hasta 20 Con Paso 1 Hacer
Si (i%2==0) Entonces
mostrar "los numero pares son:",i
Fin Si
Fin Para
FinProceso
Proceso sin_titulo
definir n , neutral, positivos, negativos
como entero
neutral=0;positivos=0;negativos=0
Para i<-0 Hasta 9 Con Paso 1 Hacer
mostrar "ingrese numero:",(i+1)
leer n
Si (n>=1) Entonces
positivos=positivos+1
Fin Si
Fin Para
mostrar "la cantidad de positivos es
de:",positivos
FinProceso
Proceso sin_titulo
definir n , neutral, positivos, negativos como entero
neutral=0;positivos=0;negativos=0
Para i<-0 Hasta 19 Con Paso 1 Hacer
mostrar "ingrese numero:",(i+1)
leer n
Si (n==0) Entonces
neutral=neutral+1
Fin Si
Si (n>=1) Entonces
positivos=positivos+1
Sino
Si (n<0) Entonces
negativos=negativos+1
Fin Si
Fin Si
Fin Para
mostrar "la cantidad neutral existente es de:",neutral
mostrar "la cantidad de positivos es de:",positivos
mostrar "la cantidad de negativos es de:",negativos
FinProceso
Proceso sin_titulo
definir may, men,n ,m Como Entero
may=0; men=9999
mostrar "ingresar cuantas veces quiere que se repita:"
leer m
Para i<-0 Hasta m Con Paso 1 Hacer
mostrar "ingresar numeros:",(i+1)
leer n
Si (n<men) Entonces
men=n
Sino
Si (n>may) Entonces
may=n
Fin Si
Fin Si
Fin Para
mostrar "el numero menor es:",men
Proceso sin_titulo
definir n, notasmay , notasmen Como Entero
notasmay=0;notasmen=0
Para i<-0 Hasta 9 Con Paso 1 Hacer
mostrar "ingresar nota",(i+1)
leer n
Si (n>=7) Entonces
notasmay=notasmay+1
Sino
Si (n<7) Entonces
notasmen=notasmen+1
Fin Si
Fin Si
Fin Para
mostrar " hay"," ",notasmay," ","notas mayores"
Proceso sin_titulo
definir i, multiploN Como Entero
multiploM=0
mostrar sin saltar " multiplo de 8 hasta 500:"
Para i<-1 Hasta 500 Con Paso 1 Hacer
Si (i mod 8==0) Entonces
mostrar sin saltar " ",i,","
Fin Si
Fin Para
FinProceso