Академический Документы
Профессиональный Документы
Культура Документы
Velocidad
D1/T1=V
Ley de ohm
Voltaje/resistencia
CODIFICACION
Programa principal
program UNAM;
uses crt, lib_plz;
var num:char;
BEGIN
repeat
marco();
centrar_texto('Universidad Nacional Autonoma de Mexico',3);
centrar_texto('Colegio de Ciencias y Humanidades',5);
centrar_texto('plantel sur',6);
centrar_texto('1.- area de un triangulo',7);
centrar_texto('2.- pendiente de dos puntos',8) ;
centrar_texto('3.- formula general',9);
centrar_texto('4.- rapidez',10);
centrar_texto('5.- intencidad de corriente',11);
centrar_texto('6.- salir ',13);
centrar_texto('digite una opcion...',17);
clrscr;
read (num);
case num of
'1':area_triangulo();
'2':pendiente();
'3':formula();
'4':velocidad();
'5':ley_ohm();
end;
clrscr;
gotoxy (12,2);
until num='6';
END.
Librera
unit lib_plz;
{
PROGRAMADOR:
DANIEL R.M.
FECHA 01/03/2016
DESCRIPCION: PLZ
}
interface
uses crt;
var
a,z,x,y,bt,xat,rept:integer;
area,m,x1,x2,y1,y2,af,bf,cf,x1f,x2f,d1,t1,vel,E,I,R :real;
procedure centrar_texto(cadena:string;reglon:integer);
procedure marco();
procedure area_triangulo();
procedure pendiente();
procedure formula();
procedure velocidad();
procedure ley_ohm();
implementation
procedure centrar_texto(cadena:string;reglon:integer);
begin
x:=length (cadena);
y:=x div 2;
z:=(40-y);
gotoxy(z,reglon);
writeln (cadena);
end;
procedure marco();
begin
for a:=1 to 79 do
begin
gotoxy (a,80);
write(chr(205));
delay (10);
end;
gotoxy (80,1);
write(chr(187));
for a:=2 to 24 do
begin
gotoxy (80,a);
write (chr(186));
delay (10);
end;
gotoxy (80,24) ;
write (chr(188));
for a:=79 downto 1 do
begin
gotoxy (a,24);
write (chr(205));
delay (10);
end;
gotoxy (1,24);
write(chr(200));
for a:=23 downto 1 do
begin
gotoxy (1,a);
write (chr(186));
delay (10);
end;
gotoxy (1,1);
write (chr(201));
end;
procedure area_triangulo();
begin
clrscr;
writeln ('ingrese el tamano de la base');
gotoxy (2,3);
read (bt);
gotoxy (2,6) ;
writeln ('ingrese la altura del triangulo');
gotoxy (2,7) ;
read (xat);
area:= (( bt)*(xat)/2 );
gotoxy (2,9);
write ('el tamao del area de tu triangulo es:',area:2:2);
readkey;
end;
procedure pendiente();
begin
clrscr;
writeln ('ingresa y2 y y1');
gotoxy (2,3);
read (y2);
gotoxy (2,4) ;
read (y1);
gotoxy (2,5);
writeln ('ingresa x2 y x1');
gotoxy (2,6);
read (x2);
gotoxy (2,7);
read (x1);
gotoxy (2,8);
m:=((y2-y1)/(x2-x1));
write ('el valor de su pendiente es:',m:2:2);
readkey;
end;
procedure
formula();
begin
clrscr;
writeln ('cual es el valor de a? ');
read (af);
writeln ('cual es el valor de b? ');
read (bf);
writeln ('cuaL es el valor de c? ');
read (cf);
x1f:=(-bf+sqrt(sqr(bf)-4*af*cf)/(2*af));
x2f:=(-bf-sqrt(sqr(bf)-4*af*cf)/(2*af));
writeln ('el valor de x1 es ',x1f:2:2);
writeln ('el valor de x2 es ',x2f:2:2);
readkey;
end;
procedure velocidad();
begin
clrscr;
writeln ('distancia en kilometros');
readln (d1);
writeln ('tiempo en horas');
readln (t1) ;
vel:=(d1/t1);
writeln ('tu velocidad es de ',vel:2:2,' k/h');
readkey;
end;
procedure ley_ohm();
begin
clrscr;
writeln ('cual es tu voltaje') ;
readln (E);
writeln ('cual es tu resistencia');
readln (R);
I:=(E/R);
writeln ('Tu intencidad total es de',I:2:4,'ampere');
readkey
end;
end.