fundamentos de programaciÓn

18
UNIVERSIDAD TÉCNICA PARTICULAR DE LOJA La Universidad Católica de Loja FUNDAMENTOS DE PROGRAMACIÓN GRUPO 6 HERNÁN CORTEZ DIEGO JAPÓN

Upload: hernanc

Post on 16-Apr-2017

221 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: FUNDAMENTOS DE PROGRAMACIÓN

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

 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

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

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

(ctg<=5);

(ctg==4); “Su aumento es de:”; 

“No recibe aumento:”; 

Fin  si

Fin

Page 6: FUNDAMENTOS DE PROGRAMACIÓN
Page 7: FUNDAMENTOS DE PROGRAMACIÓN

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

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

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

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
Page 12: FUNDAMENTOS DE PROGRAMACIÓN

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

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
Page 15: FUNDAMENTOS DE PROGRAMACIÓN

 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

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

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