Dimension control[5];//CREAMOS UN ARRAY DE 5 VALORES QUE LO USAREMOS LUEGO
//////////////////INGRESO DE LAS NOTAS EP1,EP2,EPR1,EPR2///////////////////////////////
Escribir "INGRESE NOTA DE LA EPR1"
Leer epr1
Escribir "INGRESE NOTA DE LA EPE1"
Leer epe1
Escribir "INGRESE NOTA DE LA EPR2"
Leer epr2
Escribir "INGRESE NOTA DE LA EPE2"
Leer epe2
////////////////INICIO BUCLE FOR///////////////////////
para i=1 hata 4 con paso 1 hacer
Escribir "INGRESE NOTA DE CONTROL Nª",i;
Leer control[i];
suma=suma+control[i];//CREAMOS UNA VARIABLE SUMADORA PARA LAS NOTAS DE LOS CONTROLES
finPara
///////////////FIN BUCLE FOR///////////////////////////
//CALCULO DE LAS NOTAS INGRESADAS
epr1=epr1*0.1;
epe1=epe1*0.15;
epr2=epr2*0.2;
epe2=epe2*0.25;
promcontrol=(suma/4)*0.3;
prom=epr1+epe1+epr2+epe2+promcontrol;
si(prom>=5.5)entonces//DECLARAMOS UNA CONDICION PARA LA VARIABLE PROM, PARA EVALUAR
LA CONDICION DE APROVADO O DESAPROVADO
Escribir "APROBASTE TU PROMEDIO ES: ",prom;
sino
Escribir "REPROBADO TU PROMEDIO ES: ",prom;
finSi
finSi
lunes, 7 de septiembre de 2015
Calculo de Promedio - PSeInt
EN ESTE EJEMPLO TRATARE DE MOSTRARLES LAS COSAS QUE SE PUEDEN REALIZAR CON UNOS SIMPLE CODIGOS PARA PODER MEJORAR Y ENTRENERSE PROGRAMANDO
UTILIZAREMOS LOS CICLOS FOR E IF...
EN ESTE CASO YO IMPLEMENTARE UN ARRAY PARA PODER INGRESAR 4 VALORES, SOLAMENTE PARA AHORRARNOS CODIGO Y APRENDER QUE SE PUEDEN HACER LAS COSAS
MAS SIMPLES, LO USAREMOS PARA POR INGRESAR LAS CUATRO NOTAS DEL LOS CONTROLES...
LO ANTERIOS VA DE LA MANO CON EL CICLO FOR, EL CUAL LO UTILIZAREMOS PARA IR INCREMENTANDO O SUMANDO LA SENTENCIA DECLARADA PARA PODER INGRESAR LA
CANTIDAD ESTABLECIDA EN EL ARRAY...
Y POR ULTIMO LA CONDICION IF, LO UTILIZAREMOS PARA ESTABLECER SI EL PROMEDIO RESULTANTE ES APROBATORIO O NO CONPARANDOLO CON LA NOTA MINIMA DE 5.5...
Suscribirse a:
Enviar comentarios (Atom)
Algoritmo sin_titulo
ResponderEliminar//////////////////INGRESO DE LAS NOTAS EP1,EP2,EPR1,EPR2///////////////////////////////
definir i como entero;
Escribir "INGRESE NOTA DE LA EPR1"
Leer epr1
Escribir "INGRESE NOTA DE LA EPE1"
Leer epe1
Escribir "INGRESE NOTA DE LA EPR2"
Leer epr2
Escribir "INGRESE NOTA DE LA EPE2"
Leer epe2
////////////////INICIO BUCLE FOR///////////////////////
Para i<-1 Hasta 4 Con Paso 1 Hacer
Escribir "ingrese nota de EVA °",i;
Leer conti;
sum=sum+conti;
Fin Para
Escribir "PROMEDIO DE EVAS: ",sum/4;
Escribir "PORCENTAJE DE EVAS 30%: ",sum/4*0.3;
///////////////FIN BUCLE FOR///////////////////////////
//CALCULO DE LAS NOTAS INGRESADAS
epr1=epr1*0.1;
epe1=epe1*0.15;
epr2=epr2*0.2;
epe2=epe2*0.25;
promcontrol=(sum/4)*0.3;
prom=epr1+epe1+epr2+epe2+promcontrol;
si(prom>=5.5)entonces//DECLARAMOS UNA CONDICION PARA LA VARIABLE PROM, PARA EVALUAR
Escribir "APROBASTE TU PROMEDIO ES: ",prom;
sino
Escribir "REPROBADO TU PROMEDIO ES: ",prom;
finSi
FinAlgoritmo
Me pareció muy práctica para saber cómo afectaba cada asignatura en mi promedio de notas general, algo que no entendía bien antes.
ResponderEliminar