Sei sulla pagina 1di 22

UNIVERSIDAD TCNICA DE COTOPAXI

UNIVERSIDAD TCNICA DE COTOPAXI


UNIDAD ACADMICA DE CIENCIAS DE LA INGENIERA Y APLICADAS

INGENIERA ELCTRICA
ALGORITMOS Y LENGUAJE DE PROGRAMACION
TTULO:
Realizar un programa men en donde se pueda seleccionar los siguientes de opciones de
aplicacin:

AUTORES.
CRDOVA GUARACA LUZ VANESSA
CUENCA MORALES WILMER RENE

Enero de 2016
LATACUNGA - ECUADOR.

UNIVERSIDAD TCNICA DE COTOPAXI

//Realizar un programa men en donde se pueda seleccionar los siguientes de opciones


de aplicacin:
Proceso OPCIONES_DE_APLICACION
siga= 's'
Mientras siga='s' Hacer
Escribir "menu de opciones"
Escribir "opcion 1 = SUMA 2 NUMEROS"
Escribir "opcion 2 = MULTIPLICACION 2 NUMEROS"
Escribir "opcion 3 = ENCONTRAR LA SUMA DE LOS DIGITOS DE UN NMERO
DE TRES CIFRAS"
Escribir "opcion 4 = SUMAR N NOTAS INGRESADAS POR TECLADO Y
ENCONTRAR SU PROMEDIO"
Escribir "opcion 5 = SABER SI UN NMERO ES PAR, IMPAR, POSITIVO O
NEGATIVO"
Escribir "opcion 6 = LISTA DE N NUMEROS INGRESADOS: SABER CUANTOS
SON PARES Y CUANTOS SON IMPARES"
Escribir "opcion 7 = LISTA DE NMEROS DE LA SERIE DE FIBONNACCI HASTA
N"
Escribir "opcion 8 = FACTORIAL DE UN NMERO"
Escribir "opcion 9 = SABER SI UN NUMERO ES PRIMO"
Escribir "opcion 10 = VALIDACION DE CDULA"
Escribir "opcion 11 = ENCONTRAR CENTROS NUMRICOS"
Escribir "opcion 12 = ENCONTRAR EL VALOR DE LA SERIE_1 HASTA n :2/a^2
-4/a^4 +6/a^6 -8/a^8 n"
Escribir "opcion 13 = INGRESAR UNA LISTA DE N NMEROS, SABER
CUANTOS NUMEROS PRIMOS Y CUANTOS NUMEROS, NO PRIMOS FUERON INGRESADOS"
Escribir "opcion 14 = REALIZAR UNA SIMULACION DE RIFA DAR TRES
OPORTUNIDADES Y SALIR"
Escribir "opcion 15 = ENCONTRAR EL VALOR DE LA SERIE_2 HASTA n: 2!/a4!/b+6!/a^2 -8!/b^3 +10!/a^5 -12!/b^8 ..n"
Escribir "SELECCIONE OPCION: "
Leer Op
Si Op=1 Entonces
Escribir "SUMA 2 NUMEROS"
Escribir "Ingrese un valor"
leer n1
Escribir "Ingrese otro valor"
leer n2
S=n1+n2
Escribir "La suma total es: ", S
Fin Si

UNIVERSIDAD TCNICA DE COTOPAXI


Si Op=2 Entonces
Escribir "MULTIPLICACION 2 NUMEROS"
Escribir "Ingrese un valor"
leer n1
Escribir "Ingrese otro valor"
leer n2
M=n1*n2
Escribir "La multiplicacion total es: ", M
Fin Si
Si Op=3 Entonces
Escribir "ENCONTRAR LA SUMA DE LOS DIGITOS DE UN NMERO DE
TRES CIFRAS"
Leer n
c1= trunc(n/100)
r1= n MOD 100
c2=trunc(r1/10)
r2= r1 MOD 10
S= c1+c2+r2
Escribir "la suma de los digitos es: ", S
Fin Si
Si Op=4 Entonces
Escribir "SUMAR N NOTAS INGRESADAS POR TECLADO Y ENCONTRAR
SU PROMEDIO"
Escribir "Ingrese el numero de notas"
Leer N
v=1
S=0
Mientras v<=N Hacer
Escribir "Ingrese calificacion"
Leer Cali
S<-S+Cali
v<-v+1
Fin Mientras
P=S/N
Escribir "El promedio es: ", P
Fin Si
Si Op=5 Entonces
Escribir "SABER SI UN NMERO ES PAR, IMPAR, POSITIVO O NEGATIVO"
Escribir "Ingrese un valor"
definir n como entero;
n<-0
leer n
Si n>0 Entonces
Escribir "El numero es positivo"
Sino
Si n<0 Entonces
Escribir "El numero es negativo"

UNIVERSIDAD TCNICA DE COTOPAXI

Fin Si

Fin Si
Si n es multiplo de 2 Entonces
Escribir "El numero es par"
Sino
Escribir "El numero es impar"
Fin Si
Fin Si
Si Op=6 Entonces
Escribir "LISTA DE N NUMEROS INGRESADOS: SABER CUANTOS SON
PARES Y CUANTOS SON IMPARES"
escribir "ingrese la cantidad de numeros"
Leer n
a=0
b=0
Para i<-1 Hasta n Con Paso 1 Hacer
Escribir "ingrese valor"
leer V
Si V mod 2=0 Entonces
Escribir "es par ", V
a1=a1+1
Sino
Escribir "es impar ", V
a2=a2+1
FinSi
Fin Para
Escribir "pares", a1
Escribir "impares", a2
Fin Si
Si Op=7 Entonces
Escribir "LISTA DE NMEROS DE LA SERIE DE FIBONNACCI HASTA N"
Escribir "Ingrese la cantidad de numeros a desplegarse"
leer n
a=1
b=0
Para i<-1 Hasta n Con Paso 1 Hacer
Escribir a
a<-a+b
b<-a-b
Fin Para
Fin Si
Si Op=8 Entonces
Escribir "FACTORIAL DE UN NMERO"
Escribir "Ingrese un valor"
leer n
f=1
Para i<-1 Hasta n Con Paso 1 Hacer
f<-f*i

UNIVERSIDAD TCNICA DE COTOPAXI

Escribir "El numero factorial es: ", f


Fin Para
Fin Si

Si Op=9 Entonces
Escribir "SABER SI UN NUMERO ES PRIMO"
Escribir "ingrese un numero"
Leer n
i<-2
Mientras i<n y n mod i<>0 Hacer
i<-i+1
Fin Mientras
si i=n Entonces
escribir "el numero es primo"
Sino
Escribir "el numero no es primo"
FinSi
Fin Si
Si Op=10 Entonces
Escribir "VALIDACION DE CDULA"
Definir a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 Como Entero
Leer a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
a=a1*2
Si a>9 Entonces
a=a-9
Fin Si
c=a3*2
Si c>9 Entonces
c=c-9
Fin Si
e=a5*2
Si e>9 Entonces
e=e-9
Fin Si
g=a7*2
Si g>9 Entonces
g=g-9
Fin Si
i=a9*2
Si i>9 Entonces
i=i-9
Fin Si
impares=a+c+e+g+i
Escribir "esto es: ", impares
pares=a2+a4+a6+a8
Escribir "esto es: ", pares
total=pares + iimpar

UNIVERSIDAD TCNICA DE COTOPAXI

Escribir total

Si total<-10 Entonces
total=total - 10
Escribir total
Sino
Fin Si
Si total<20&&total>10
total=total-20
Escribir total
Sino
Fin Si
Si total<30&&total>20
total=total-30
Escribir total
Sino
Fin Si
Si total<40&&total>30
total=total-40
Escribir total
Sino
Fin Si
Si total<50&&total>40
total=total-50
Escribir total
Sino
Fin Si
Si total<60&&total>50
total=total-60
Escribir total
Sino
Fin Si
Si total<70&&total>60
total=total-70
Escribir total
Sino
Fin Si
Si total<80&&total>70
total=total-80
Escribir total
Sino
Fin Si
Si total<90&&total>80
total=total-90
Escribir total
Sino
Fin Si
Fin Si
Si Op=11 Entonces

Entonces

Entonces

Entonces

Entonces

Entonces

Entonces

Entonces

Entonces

UNIVERSIDAD TCNICA DE COTOPAXI

Escribir "ENCONTRAR CENTROS NUMRICOS"


Escribir "Ingrese un valor"
leer n
cn<-rc(((n^2)+n)/2)
Escribir "Su centro numerico es: ",cn
Fin Si

Si op=12 Entonces
Escribir "ENCONTRAR EL VALOR DE LA SERIE_1 HASTA n (2/a^2 -4/a^4
+6/a^6 -8/a^8 n)"
Escribir "Ingrese la cantidad de secuencialidad"
leer can
Escribir "Ingrese el valor de a"
leer d
expo=2
a=1
b=0
ac1=0
///positivos
Para i<-1 Hasta can Con Paso 2 Hacer
ac1=a/(d^expo)
expo= expo+4
a=a+b
b=a-b
a=a+b
b=a-b
Fin Para
///negativos
expo=4
a=1
b=0
ac2=0
a=a+b
b=a-b
Para i<-1 Hasta can Con Paso 2 Hacer
ac2=a/(d^expo)
expo= expo+4
a=a+b
b=a-b
a=a+b
b=a-b
Fin Para
r=ac1-ac2
Escribir "El resultado de la serie es: " , r
Fin Si
Si Op=13 Entonces
Escribir "INGRESAR UNA LISTA DE N NMEROS, SABER CUANTOS
NUMEROS PRIMOS Y CUANTOS NUMEROS, NO PRIMOS FUERON INGRESADOS"
acum1=0
acum2=0
escribir "ingrese la cantidad de numeros"

UNIVERSIDAD TCNICA DE COTOPAXI

Leer n
a=0
b=0
Para i<-1 Hasta n Con Paso 1 Hacer
Escribir "ingrese valor"
leer V
Si V mod 2=0 Entonces
Escribir "no es primo ", V
acum1=acum1+1
Sino
Escribir "es primo ", V
acum2=acum2+1
FinSi
Fin Para
Escribir "primos", acum2
Escribir "no primos", acum1
Fin Si

Si Op=14 Entonces
Escribir "REALIZAR UNA SIMULACION DE RIFA DAR TRES
OPORTUNIDADES Y SALIR"
Escribir "ingresar un numero entre el 1 y 25 al azar"
Escribir "tiene tres oportunidades de ganar"
Para i<-1 Hasta 3 Con Paso 1 Hacer
Leer n
Si n=15 Entonces
Escribir "Usted es el ganador"
Sino
Si n=2 Entonces
Escribir "Usted es el Ganador"
Sino
Si n=19 Entonces
Escribir "Usted es el ganador"
Sino
Escribir "suerte para la proxima"
Fin Si
Fin Si
Fin Si
Fin Para
Escribir "Gracias por participar"
Fin Si
Si Op=15 Entonces
Escribir "ENCONTRAR EL VALOR DE LA SERIE_2 HASTA n"
Escribir "escribir la cantidad de numeros que desee que aparezca de
la serie"
Leer n
a=1
b=0
i=0
Para i<-1 Hasta n Con Paso 1 Hacer

UNIVERSIDAD TCNICA DE COTOPAXI

r<-i* 2
Escribir p1,r,"!/ ",p,"^",a
a<-a+b
b<-a-b
Si i mod 2=0 Entonces
Escribir p=a
p1=""
Sino
p1="-"
Escribir p=b
Fin Si
Fin Para
Fin Si

Escribir "Desea continuar, digite s, caso contrario digite n u otro valor."


Leer siga
Fin Mientras
FinProceso

PRUEBA DE ESCRITORIO
OPCIN 1

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 2

OPCIN 3

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 4

OPCIN 5

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 6

OPCIN 7

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 8

OPCIN 9

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 10

OPCIN 11

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 12

OPCIN 13

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN 14

UNIVERSIDAD TCNICA DE COTOPAXI

OPCIN15

DIAGRAMA DE FLUJO

UNIVERSIDAD TCNICA DE COTOPAXI

UNIVERSIDAD TCNICA DE COTOPAXI

UNIVERSIDAD TCNICA DE COTOPAXI

UNIVERSIDAD TCNICA DE COTOPAXI

UNIVERSIDAD TCNICA DE COTOPAXI

Potrebbero piacerti anche