Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Practica 3
Practica 3
Ejercicio 1
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
n:Integer;
c:Integer;
i:Char;
begin
writeln('***PROGRAMA PARA CALCULAR EL CUBO DE LOS NUMEROS***');
i:='s';
while (i='s') or (i='S') do
begin
repeat
Write('Ingrese un numero: ');
ReadLn(n);
until(n>0);
c:=n*n*n;
WriteLn(c,' ');
Write('Desea ingresar otro numero? S/N: ');
ReadLn(i);
end;
ReadLn;
end.
Ejercicio 2
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
cc:Integer;
mayc:Integer;
menc:Integer;
num:Integer;
n:Integer;
i:Integer;
begin
writeln('***PROGRAMA PARA DETERMINAR N CANTIDADES ***');
{$APPTYPE CONSOLE}
uses
SysUtils;
var
a:Integer;
m:Integer;
i:Integer;
s:Real;
c:Real;
ahorro:Real;
interes :Real;
inv:Real;
anual:Real;
begin
writeln('***PROGRAMA PARA DETERMINAR N CANTIDADES ***');
s:=0;
Write('Ingrese los anios: ');
ReadLn(a);
m:=a*12;
for i:=1 to m do
begin
Write('Digite la cantidad a depositar: ');
ReadLn(c_ahorro);
interes := (c_ahorro + s) * 0.1 * (m/360*a);
inv_anual := c_ahorro + interes;
s := s + inv_anual;
end;
WriteLn('Inversion anual: ',inv_anual:0:2);
WriteLn('Interes: ',interes:0:2);
WriteLn('Total inversion: ',s:0:2);
ReadLn;
end.
Ejercicio 4
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
Var
n:Integer;
i:Integer;
ht:Integer;
nom:String;
suelH,suelS,desc:Real;
begin
writeln('***PROGRAMA PARA DETERMINAR EL SUELDO SEMANAL***');
{$APPTYPE CONSOLE}
uses
SysUtils;
var
i:Integer;
begin
writeln('***PROGRAMA PARA DETERMINAR LOS 200 PRIMEROS PARES***');
Ejercicio 6
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
i:Integer;
c:Integer;
n:Integer;
begin
writeln('***PROGRAMA PARA GENERAR Y DESPLAZAR N NUMEROS***');
c:=1;
Write('Cuantos numeros desea generar: ');
ReadLn(n);
for i:=1 to n do
begin
Write(c,' ');
c:=c+4;
end;
ReadLn;
end.
Ejercicio 7
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
i:Integer;
n:Integer;
s :Integer;
c:Integer;
begin
writeln('***PROGRAMA PARA OBTENER LA SUMA DE N TERMINOS***');
c:=1;
{$APPTYPE CONSOLE}
uses
SysUtils,
Math;
var
n:Integer;
x:Integer;
i:Integer;
f:Integer;
j:Integer;
s:Real;
t:Real;
begin
writeln('***PROGRAMA PARA OBTENER UNA FUNCION EXPONENCIAL***');