BUENAS QUERIDOS AMIGOS Y AFELIADOS DEL CLUB DELPHI COMO EN OTRA OCASIONES, HE VUELTO ACA PARA PEDIR UN POCO DE SU AYUDA Y CONOCIMIENTOS SOBRE EL COMPLEJO PROGRAMA DELPHI:
EN ESTA OCACION LES TRAIGO COMO TAREA ( es solo Juego es un programa de la Universidad), el siguiente programa:
el cual desearía que me ayudaran a corregir el los posibles errores presentes en el y si es posible mostrarme hasta una mejor opción de cómo poder codificarlo.
Por otra parte el siguiente programa quería realizarlo usando ya se la estructura Repetitiva “ While to do” o la “Fort o Do” pero en visto de la falta de practica y conocimientos lo hice de la siguiente manera;
El PROGRAMA QUE DISEÑE SE BASA EN EL CALCULO DE CENTROIDES DE FIGURAS COMPUESTA, TENIENDO PREVIENTA EN AREA Y LAS COORDENADAS CENTROIDALES DE CADA FIGURA POR SEPARADO.
Les doy por adalantado las gracias aquellos que se adentren en mi Post también a los q tengan la molestia en ayudar,
Me despido con un cordial saludo : atta: DarNNezT
Código Delphi
[-]
TForm1.Button1Click(Sender: TObject);
var a1,a2,a3,a4,a5,a6,areas:real; x1,y1,z1:real;
x2,y2,z2:real;
x3,y3,z3:real;
x4,y4,z4:real;
x5,y5,z5:real;
x6,y6,z6:real;
xc,yc,zc:real
ax1,ay1,az1:real;
ax2,ay2,az2:real;
ax3,ay3,az3:real;
ax4,ay4,az4:real;
ax5,ay5,az5:real;
ax6,ay6,az6:real;
begin a1:= strtofloat(inputbox('VALOR DE LA PRIMERA AREA','A1=',''));
x1:= strtofloat(inputbox('CENTROIDE DE LA PRIMERA FIGURA','x1=',''));
y1:= strtofloat(inputbox('CENTROIDE DE LA PRIMERA FIGURA','y1=',''));
z1:= strtofloat(inputbox('CENTROIDE DE LA PRIMERA FIGURA','z1=',''));
ax1:= a1*x1;
ay1:= a1*y1;
az1:= a1*z1;
a2:= strtofloat(inputbox('VALOR DE LA AREA','A2=',''));
x2:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','x2=',''));
y2:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','y2=',''));
z2:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','z2=',''));
ax2:= a2*x2;
ay2:= a2*y2;
az2:= a2*z2;
a3:= strtofloat(inputbox('VALOR DE LA AREA','A3=',''));
x3:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','x3=',''));
y3:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','y3=',''));
z3:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','z3=',''));
ax3:= a*x3;
ay3:= a3*y3;
az3:= a3*z3;
a4:= strtofloat(inputbox('VALOR DE LA AREA','A4=',''));
x4:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','x4=',''));
y4:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','y4=',''));
z4:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','z4=',''));
ax4:= a4*x4;
ay4:= a4*y4;
az4:= a4*z4;
a5:= strtofloat(inputbox('VALOR DE LA AREA','A5=',''));
x5:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','x5=',''));
y5:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','y5=',''));
z5:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','z5=',''));
ax5:= a5*x5;
ay5:= a5*y5;
az5:= a5*z5;
a6:= strtofloat(inputbox('VALOR DE LA AREA','A6=',''));
x6:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','x6=',''));
y6:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','y6=',''));
z6:= strtofloat(inputbox('CENTROIDE DE LA FIGURA','z6=',''));
ax6:= a6*x6;
ay6:= a6*y6;
az6:= a6*z6;
areas:= a1+a2+a3+a4+a5+a6;
xc:= (ax1+ax2+ax3+ax4+ax5+ax16)/areas;
yc:= (ay1+ay2+ay3+ay4+ay5+ay6)/areas;
zc:= (az1+az2+az3+az4+az5+az6)/areas;
showmessage:=(' LA COORDENADA XC:='+ formatfloat('0.00',xc));
showmessage:=(' LA COORDENADA YC:='+ formatfloat('0.00',yc));
showmessage:=(' LA COORDENADA ZC:='+ formatfloat('0.00',zc));