fundamentos de programaciÓn
TRANSCRIPT
![Page 1: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/1.jpg)
UNIVERSIDAD TÉCNICA
PARTICULAR DE LOJA
La Universidad Católica de Loja
FUNDAMENTOS
DE PROGRAMACIÓN
GRUPO 6
HERNÁN CORTEZ
DIEGO JAPÓN
![Page 2: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/2.jpg)
ALGORITMO #12
Construir un algoritmo que lea la categoría y el sueldo de un trabajador, calcule el aumento correspondiente teniendo en cuenta la siguiente tabla:
![Page 3: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/3.jpg)
Pseudocódigo
InicioReal a; Entero ctg, s;Escriba: “Ingrese categoría:”;Lea: ctg;Escriba: “Ingrese sueldo:”;Lea: s;Si (ctg==1){ (a=s*0,10); Escriba: "Su aumento es de: " << a << " dolares";Fin siElse Si (ctg==2){ (a=s*0,15); Escriba: "Su aumento es de: " << a << " dolares";Fin else siElse Si(ctg==3){ (a=s*0,8); Escriba: "Su aumento es de: " << a << " dolares";Fin else siElse Si(ctg==4){ (a=s*0,7); Escriba: "Su aumento es de: " << a << " dolares";Fin else siElse Si Si(ctg==5){ (a=s*0); Escriba: “ No recibe aumento:”;Fin else siFin
![Page 4: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/4.jpg)
Inicio
Real a; Entero ctg, s;
“Ingrese categoría:”
Ctg;
“Ingrese sueldo:”;
S;
(ctg==1); “Su aumento es de:”;
“Su aumento es de: “;
“Su aumento es de: “;
(ctg==2);
(ctg==3);
![Page 5: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/5.jpg)
(ctg<=5);
(ctg==4); “Su aumento es de:”;
“No recibe aumento:”;
Fin si
Fin
![Page 6: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/6.jpg)
![Page 7: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/7.jpg)
Cuatro enteros entre 0 y 100 representan las puntuaciones de un estudiante de informática. Escribir un programa para encontrar la media de estas puntuaciones y visualizar una tablado notas de acuerdo al siguiente cuadro:
MEDIA PUNTUACI ON 90-100 A 80-89 B 70-79 C 60-69 D 0-59 E
ALGORITMO #22
![Page 8: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/8.jpg)
Pseudocódigo
INICIOLeer N1, N2, N3, N4
Sí (N1>= 0 y N1<=100) y (N2>= 0 y N2<=100) y (N3>= 0 y N3<=100) y (N4>= 0 y N4<=100) entonces prom= ( N1+ N2+ N3+ N4)/4 Sí no Escribir “Algún N esta fuera de rango”Fin _síSí (prom>= 0 y prom<= 59) entoncesEscribir “Tu puntuación es E”Fin _síSí no sí (prom>= 60 y prom<= 69) entoncesEscribir “Tu puntuación es d”Fin _síSí no sí (prom>= 70 y prom<= 79) entoncesEscribir “Tu puntuación es C”Fin _síSí no sí (prom>= 80 y prom<= 89) entoncesEscribir “Tu puntuación es B”Fin _síSí no sí (prom>= 90 y prom<= 100) entoncesEscribir “Tu puntuación es A”Fin _síFIN
![Page 9: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/9.jpg)
Inicio
n1, n2, n3, n4, prom ;
n1, n2, n3, n4
“Ingrese el valor de n1:”;“Ingrese el valor de n2:”;“Ingrese el valor de n3:”;“Ingrese el valor de n4:”;
(N1>= 0 y N1<=100) y (N2>= 0 y N2<=100) y (N3>= 0 y N3<=100) y (N4>= 0 y N4<=100)
prom= ( N1+ N2+ N3+ N4)/4 “Algún N esta fuera de rango”;
prom>= 0 y prom<= 59
“Tu puntuacion es E”;
![Page 10: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/10.jpg)
prom>= 60 y prom<= 69
“Tu puntuacion es D”;
prom>= 70 y prom<= 79
“Tu puntuacion es C”;
prom>= 80 y prom<= 89
“Tu puntuacion es B”;
prom>= 90 y prom<= 100
“Tu puntuacion es A”;
Fin
![Page 11: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/11.jpg)
![Page 12: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/12.jpg)
ALGORITMO #32
Desarrollar un algoritmo que lea como dato el valor de n y calcule los valores de la ecuación y= 3x2-25, para x inicial x= 2.8 e incremento de 0.01. El proceso debe repetirse hasta que y<= 0 o sí no se cumple esta condición, hasta que hallan calculado n valores de y.
I NI CI O 1. Leer n 2. Mientras (y<0 o i>n) hacer Y= 3(x*x) -25 x= x + 0.01 i= i+1 Fin _mientras 3. Escribir y 4. FI N
![Page 13: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/13.jpg)
Inicio
i=0;n;Y;
X=2,8;
(y<0 o i>n) ;
Y= 3(x*x) -25;x= x + 0.01;
i= i+1;
“y :”;
Fin
“Ingrese el valor de n:”
![Page 14: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/14.jpg)
![Page 15: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/15.jpg)
ALGORITMO #43
Lea un vector de N elementos y luego imprima cuales elementos son múltiplos de 6 y la suma de sus múltiplos.
![Page 16: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/16.jpg)
InicioInti c=0, n, a;Lea: n;Escriba: “Los múltiplos de 6 son:”;(“%d”,&n)do{ printf("%d ",c); a=a+c; c=c+6; }while(c<=n); Escriba: “La suma es:”;Fin doFin
![Page 17: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/17.jpg)
Inicio
n
“Los múltiplos de 6 son:”;
Inti c=0, n, a;
(“%d”,&n)
("%d ",c); a=a+c; c=c+6;
do
(c<=n);
“La suma es:”;
Fin
![Page 18: FUNDAMENTOS DE PROGRAMACIÓN](https://reader036.vdocumento.com/reader036/viewer/2022062905/587121591a28abe4448b520b/html5/thumbnails/18.jpg)