viernes, 1 de mayo de 2009

Multiplicacion de menores y divicion de mayores


unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure BitBtn1Click(Sender: TObject);
private { Private declarations }
public { Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1ClickSender:TObject);
var
a:integer;
b:integer;
c:integer;
d:integer;
m,n:real;
begin
a:=StrToInt(Edit1.Text);
b:=StrToInt(Edit2.Text);
c:=StrToInt(Edit3.Text);
d:=StrToInt(Edit4.Text);

if((a>b) and (a>c) and (a>d))then
begin
if((b>c)and (b>d))then
begin
m:=a/b;
n:=c*d;
end;
else
begin
If((c>b)and (c>d))then
begin
m:=a/c;
n:=b*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>c)and(d>b))then
begin
m:=a/d;
n:=b*c;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;

end
else
begin
if((b>a) and (b>c) and (b>d))then
begin//inicio
if((a>c)and (a>d))then
begin
m:=b/a;
n:=c*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((c>a)and (c>d))then
begin
m:=b/c;
n:=a*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>a)and(d>c))then
begin
m:=b/d;
n:=a*c; edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;


end//fin
else
begin
if((c>a) and (c>b) and (c>d))then
begin//inicio
if((a>b)and (a>d))then
begin
m:=c/a;
n:=b*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((b>a)and (b>d))then
begin
m:=c/b;
n:=a*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>a)and(d>b))then
begin
m:=c/d;
n:=a*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;
end//final
else
begin
if((d>a) and (d>b) and (d>c))then
begin//inicio
if((a>b)and (a>c))then
begin
m:=d/a;
n:=c*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((b>a)and (b>d))then
begin
m:=d/b;
n:=a*c;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((c>a)and(c>b))then
begin
m:=d/c;
n:=a*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;

end;//final

end;
end;

end;


end;
end.

jueves, 23 de abril de 2009

EL MENOR DE 5 MUNEROS

unit el nº menor;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
CLOSE
end;

procedure TForm1.Button1Click(Sender: TObject);
VAR
a,b,c,d,e,min:real;
begin
try
a:= StrTofloat(Edit1.text);
b:= StrTofloat(Edit2.text);
c:= StrTofloat(Edit3.text);
d:= StrTofloat(Edit4.text);
e:= StrTofloat(Edit5.text);
min:= a;
If b < min then

min:= b;
If c < min then

min:= c;
If d < min then

min:= d;
If e < min then

min:= e;
Edit6.Text:=Floattostr(min);

except

on
EconvertError do ShowMessage(#9' ERROR EN LOS DATOS INGRESADOS ');

end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
Edit6.Clear;

Edit1.SetFocus;


end;



end

DIST. 2 PTO'S ESFERICOS

unit distancia entre dos ptos coord. esfericas;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit7: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
VAR a,b,c,d,e,f,x1,x2,y1,y2,z1,z2,dist:real;
begin
a:=0 ;
b:=0 ;
c:=0 ;
d:=0 ;
e:=0;
f:=0;
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);
e:=strtofloat(edit5.Text);
f:=strtofloat(edit6.Text);

x1:=a*cos(pi*b/180)*cos(pi*c/180);
y1:=a*cos(pi*b/180)*sin(pi*c/180);
z1:=a*sin(pi*b/180);
x2:=d*cos(pi*e/180)*cos(pi*f/180);
y2:=d*cos(pi*e/180)*sin(pi*f/180);
z2:=d*sin(pi*e/180);
dist:=sqrt(sqr(x2-x1)+sqr(y2-y1)+sqr(y2-y1));
edit7.Text:=floattostr(dist);

end;

end.

PROMEDIO NOTAS CON 7 ALUMNOS

program Project1;( promedio notas)

uses
dialogs,sysutils;
type estudiante=class
procedure iniciar(n:string;n1,n2,n3,n4,n5,n6,n7:real);
function media:real;
procedure mostrar;
private
nombre:string;
nota1,nota2,nota3,nota4,nota5,nota6,nota7:real;
end;
procedure estudiante.iniciar;
begin
nombre:=n;nota1:=n1;nota2:=n2;nota3:=n3;nota4:=n4;nota5:=n5;nota6:=n6;nota7:=n7
end;
function estudiante.media;
begin
media:=(nota1+nota2+nota3+nota4+nota5+nota6+nota7)/7;
end;
procedure estudiante.mostrar;
begin
showmessage(nombre+'ha obtenido en el promedio de 7 materias: '+floattostr(media));
end;
var e1,e2,e3,e4:estudiante;
begin
e1:=estudiante.create;
e2:=estudiante.create;
e3:=estudiante.create;
e4:=estudiante.create;
e1.iniciar('LINA ',15,68,59,64,89,97,100);e1.mostrar;
e2.iniciar('KEVIN ',15,68,59,64,89,97,100);e2.mostrar;
e3.iniciar('VICTOR ',15,68,59,64,89,97,100);e3.mostrar;
e4.iniciar('MAURICIO ',15,68,59,64,89,97,100);e4.mostrar;
END.

domingo, 19 de abril de 2009

INSTRUCCIONES



Manden todas sus dudas o errores que tengan algunos de los programas haciendo un click en el titulo de cualquier programa
posteriormente el navegador los llevara a una pagina nueva solo para el porgrama mostrandoles ademas un cuadro de opiniones en el cual pueden colocar su opinion o sugerencia para los programas como tmbien para las clases en aula.

jueves, 2 de abril de 2009

PROGRAMA CAMBIO DE MONEDA


unit Unit1;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn2Click(Sender: TObject);
private { Private declarations }
public { Public declarations }
end;

var Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.BitBtn2Click(Sender: TObject);
var bol,sus,eur:real;
begin
bol:=0;
bol:=strtofloat (edit1.Text);
sus:=bol/7.07;
eur:=bol/9.86;
edit2.Text:=floattostr(sus)+'$us.';
edit3.Text:=floattostr(eur)+'Euros';
end;
end.

PORGRAMA SALUDO



program Saludo;
uses Sysutils,Dialogs;
begin
showmessage ('hola'+#10+'que tal como estas'+#9+'el dia de hoy'+#13+'Atte. jose'); showmessage ('bien');
//#10 genera nueva linea(un enter)
//#13 genera nueva linea(un enter)
//#9 genera espacio etre palabras
end.