Вы находитесь на странице: 1из 4

Raices de cuadrática:

Algoritmo Raices

Definir a,b,c,x1,x2 Como Real;

Escribir "Ingrese el valor de a";

Leer a;

Escribir "Ingrese el valor de b";

Leer b;

Escribir "Ingrese el valor de c";

Leer c;

d<-b*b-4*a*c;

e<-2*a;

Si b*b-4*a*c>=0 Entonces

Escribir "x1=" (-b+rc(d))/e

Escribir "x2=" (-b-rc(d))/e

SiNo

Escribir "x1=" (-b)/e "+" rc(-d)/e "i"

Escribir "x2=" (-b)/e "-" rc(-d)/e "i"

Fin Si

FinAlgoritmo
Prueba

Algoritmo prueba

Definir e Como Entero;

Definir g Como Caracter;

Escribir "Ingrese edad";

Leer e;

Escribir "Ingrese genero";

Leer g;

Si 18<e && e<25 && g="Masculino" Entonces

Escribir "Es apto para el servicio militar"

SiNo

Escribir "No es apto para el servicio militar"

Fin Si

FinAlgoritmo
Algoritmo Matricula

Escribir "ingrese las notas";

Escribir "NOTA 1";

Leer n1;

Escribir "NOTA 2";

Leer n2;

Escribir "NOTA 3";

Leer n3;

Escribir "NOTA 4";

Leer n4;

Escribir "NOTA 5";

Leer n5;

Escribir "NOTA 6";

Leer n6;

Escribir "Cuanto es la pension";

Leer e;

Escribir "Cuanto es el IVA";

Leer x;

Definir p,M,N Como Real;

p<- (n1+n2+n3+n4+n5+n6)/6 ;

M<- 0.3*e;

N<- (e+x);

Si p>=4 Entonces

Escribir "La matricula sera:"

Escribir M;

SiNo

Escribir "La matricula sera:"

Escribir N;

Fin Si

FinAlgoritmo
Algoritmo Empresa

Definir monto,interes,fabricante,propio,banco Como Real;

Escribir "Ingrese el monto de la compra";

leer monto;

Si monto>500000 Entonces

propio<-monto*0.55;

banco<-monto*0.3;

fabricante<-monto*0.25;

interes<-fabricante*0.2;

SiNo

propio<-monto*0.7;

banco<-monto*0;

fabricante<-monto*0.3;

interes<-fabricante*0.2;

Fin Si

Escribir "Del propio dinero",propio;

Escribir "Del banco",banco;

Escribir "Credito del fabricante"," ",fabricante," ","con interes de",interes;

FinAlgoritmo

Вам также может понравиться