Programas pascal
uses crt;
var
n1,n2:integer;
begin
clrscr;
textcolor(7);
writeln('Ejercicio 1.- Determitar el mayor de dos numeros');
textcolor(2);
writeln;writeln;
writeln(' EL MAYOR DE DOS NUMEROS');
writeln;writeln;
textcolor(3);
write(' Teclear primer numero: ');
readln(n1);
writeln;writeln;
write(' Teclear segundo numero: ');
readln(n2);writeln;writeln;
textcolor(5);
if(n1>n2)then
write(' El mayor es: ',n1)
else
write(' El mayor es: ',n2);
readln;
end.
program tres_numeros;
uses crt;
var
a,b,c:integer;
begin
clrscr;
textcolor(7);
writeln('Ejercicio 2.- Determinar el valor de tres numeros');
textcolor(2);
writeln;writeln;
writeln(' MAYOR DE TRES NUMEROS');
writeln;writeln;
textcolor(3);
write('Teclear primer numero: ');
readln(a);
writeln;
write(' Teclear segundo numero: ');
readln(b);
writeln;
write(' Teclear tercer numero: ');
readln(c);
writeln;writeln;
textcolor(5);
if(a>b) and (a>c) then
write(' El mayor es: ',a)
else
begin
if(b>a) and (b>c) then
write(' El mayor es: ',b)
else
write(' El mayor es: ',c)
end;
readln
end.
program descuento;uses crt;
var
ibf,d,f:real;
const
a= 0.20;
b= 100000;
begin
clrscr;
textcolor(7);
writeln('Ejercicio 3.- Determinar el importe bruto de una factura');
writeln(' segun los criterios siguientes: ');
writeln;
writeln(' *Importe bruto menor que 100000 = sin descuento ');
writeln(' *Importe bruto mayor que 100000 = 20% dedescuento ');
textcolor(2);
writeln;writeln;
write(' DETERMINAR EL IMPORTE BRUTO DE UNA FACTURA');
writeln;writeln;writeln;
textcolor(3);
write(' Factura: ');
readln(f);
writeln;
textcolor(5);
if(f<b) then
writeln(' Nota: No hay descuento.')
else
begin
d:= f*a;
ibf:= f-d;
writeln(' Descuento: ',d:1:2);
writeln;
writeln(' Importe bruto de la factura: ',ibf:1:2);writeln;
writeln(' Nota: Si hay un descuencuento del 20%.');
writeln;
end;
readln
end.
program descuentodos;
uses crt;
var
ibf,d,f:real;
const
a= 0.20;
b= 50000;
begin
clrscr;
textcolor(7);
writeln('Ejercicio 4.- Determinar el importe bruto de una factura');
writeln(' segun los criterios siguientes: ');
writeln;
writeln(' *Importebruto menor que 50000 = sin descuento ');
writeln(' *Importe bruto mayor que 50000 = 20% de descuento ');
textcolor(3);
writeln;writeln;
write(' DETERMINAR EL IMPORTE BRUTO DE UNA FACTURA');
writeln;writeln;writeln;
textcolor(5);
write(' Factura: ');
readln(f);
writeln;
textcolor(5);
if(f<b) then
writeln(' Nota: No hay descuento.')
else
begin
d:= f*a;ibf:= f-d;
writeln(' Descuento: ',d:1:2);
writeln;
writeln(' Importe bruto de la factura: ',ibf:1:2);
writeln;
writeln(' Nota: Si hay un descuencuento del 20%.');
writeln;
end;
readln
end.
program pasteleria;
useS crt;
VAR
npanq,npast,nbolo,nota,desc,tpagar:real;
const
a= 0.05;
b= 500;
c=40;
d=5;
e=200;
begin
clrscr;
textcolor(7);
writeln('Ejecicio 5.- Calcular eltotal a pagar de tres articulos adquiridos en ');
writeln(' en una pasteleria ');
writeln;
writeln(' * Si la nota excede de 500 pesos hay un descuento del 5% ');
writeln(' * Si la nota no excede de 500 pesos no hay descuento ');
textcolor(3);
writeln;writeln;
write(' TOTAL A PAGAR DE UNA NOTA');
writeln;writeln;
textcolor(2);
write(' Cantidadde panqueques: ');
readln(npanq);
writeln;
write(' Cantidad de bolobanes: ');
readln(nbolo);
writeln;
write(' Cantidad de pasteles: ');
readln(npast);
writeln;writeln;
textcolor(5);
NOTA:=(npast*e)+ (nbolo*d)+ (npanq*c);
writeln(' Nota de los articulos : ',nota:1:2);
writeln;
if (nota<b) then
writeln(' No hay descuento.')
else
begin
desc:=nota*a;
tpagar:=nota+desc;
writeln('...
Regístrate para leer el documento completo.