Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 02-02-2010
Givanti Givanti is offline
Registrado
 
Registrado: feb 2010
Posts: 3
Poder: 0
Givanti Va por buen camino
Ayuda

Hola bueno en el colegio me pidieron hacer un programa que me pidiera valores y me de resultado eso creo ya esta bien , bueno tambien me pidieron que hciiera una parte donde me de el valor de 3 lados y me ponga que tipo d etraingulo es si equilatero , isoceles o escaleno , bueno es ahi donde tengo mi error espero me puedan ayudar anexo el codigo para ver si voy bien :

Código Delphi [-]

{$APPTYPE CONSOLE}
uses
  SysUtils;

var
 opc,tabla,x,respu,triangulo:integer;
   lado1,lado2,lado3:real;
   num1,num2,c,d,e,f,g,h,i,j:real;
 b:string;
begin
  { TODO -oUser -cConsole Main : Insert code here }
b:='si';
  while b= 'si' do
  begin
writeln('******CALCULOS*****');
writeln('*****1)TABLAS******');
writeln('******2)OPERACIONES BASICAS****');
writeln('*****3)TRIANGULOS*****');
writeln('*****QUE OPCION DESEAS***');
readln(opc);
if opc=1 then
begin
writeln('****TABLAS****');
writeln('QUE TABLA DESEAS CALCULAR----->');
readln(tabla);
for x:=1 to 10 do
begin
respu:=tabla*x;
writeln('=',respu);
end;
writeln('****DESEAS OTRA OPCION--->');
readln(b);
end;
if opc=2 then
begin
writeln('*****OPERACIONES BASICAS***');
writeln('DAME UN NUMERO--->');
readln(num1);
writeln('DAME OTRO NUMERO----->');
readln(num2);
c:=num1+num2;
writeln('LA SUMA ES--.>',c:2:2);
d:=num1-num2;
writeln('LA RESTA ES---->',d:2:2);
e:=num1*num2;
writeln('LA MULTIPLICACION ES---->',e:2:2);
f:=num1/num2;
writeln('LA DIVISION ES---->',f:2:2);
writeln('DESEAS OTRA OPCION---->');
readln(b);
end;
if opc=3 then
begin
writeln('*****TRIANGULOS****');
writeln('VALOR DE LADO1--->');
readln(lado1);
writeln('VALOR DE LADO2---->');
readln(lado2);
writeln('VALOR DE LADO3---->');
readln(lado3);
end;
if (lado1=lado2) and (lado2=lado3)  then
begin
writeln('**EL TIPO DE TRIANGULO ES EQUILATERO**');
end
if(lado1=lado2)and(lado2=lado3)or(lado1=lado3)then < --- aqui me sale missing operator semicolon

begin
writeln('***EL TIPO DE TRIANGULO ES ISOCELES***');
end
else
begin
writeln('****EL TIPO DE TRIANGULO ES ESCALENO***');
writeln('DESEAS OTRA OPCION---->');
readln(opc);
end;
end;
readln;
end.
Responder Con Cita
  #2  
Antiguo 02-02-2010
Avatar de Ñuño Martínez
Ñuño Martínez Ñuño Martínez is offline
Moderador
 
Registrado: jul 2006
Ubicación: Ciudad Catedral, Españistán
Posts: 6.000
Poder: 25
Ñuño Martínez Tiene un aura espectacularÑuño Martínez Tiene un aura espectacular
Hola Givanti.

Si te fijas, se te ha olvidado poner un "punto y coma" (semicolon en inglés) en la línea anterior. El resto del código parece estar bien, aunque sólo lo he leído por encima.

¡Y sé bienvenido al maravilloso mundo de la programación!
__________________
Proyectos actuales --> Allegro 5 Pascal ¡y Delphi!|MinGRo Game Engine
Responder Con Cita
  #3  
Antiguo 02-02-2010
Avatar de ElKurgan
[ElKurgan] ElKurgan is offline
Miembro Premium
 
Registrado: nov 2005
Posts: 1.232
Poder: 20
ElKurgan Va camino a la fama
Código Delphi [-]
if (lado1=lado2) and (lado2=lado3)  then
begin
writeln('**EL TIPO DE TRIANGULO ES EQUILATERO**');
end  // Es que aqui te falta el punto y coma
if(lado1=lado2)and(lado2=lado3)or(lado1=lado3)then < --- aqui me sale missing operator semicolon

Saludos

Última edición por delphi.com.ar fecha: 02-02-2010 a las 16:40:31. Razón: Corrección de las etiquetas
Responder Con Cita
  #4  
Antiguo 02-02-2010
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.233
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Aparte de eso, yo añadiría allgun paréntesis más a esa línea, para clarificar la prioridad de las operaciones.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #5  
Antiguo 02-02-2010
rafita rafita is offline
Miembro
 
Registrado: ago 2003
Ubicación: Cuenca- España.
Posts: 309
Poder: 21
rafita Va por buen camino
Por la forma de poner los IF yo creo que le falta un ELSE,
y estoy de acuerdo con Neftali que debería utilizar algún paréntesis más, porque además de funcionar, también ha de ser fácilmente revisable.

Un saludo,
__________________
Rafita.
Responder Con Cita
  #6  
Antiguo 02-02-2010
Avatar de mamcx
mamcx mamcx is offline
Moderador
 
Registrado: sep 2004
Ubicación: Medellín - Colombia
Posts: 3.911
Poder: 25
mamcx Tiene un aura espectacularmamcx Tiene un aura espectacularmamcx Tiene un aura espectacular
Tambien te recomiendo que mires http://www.clubdelphi.com/foros/guiaestilo.php, para facilitar el recibir ayuda en el futuro.

Es siempre mejor ser muy concreto en el titulo del hilo. "Ayuda" es muy abierto "Error de compilacion" todavia es muy abierto "Saca error 'missing operator semicolon'" y tienes un 10!
__________________
El malabarista.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ayuda para la ayuda maxvera Varios 4 12-05-2007 21:13:44
Instalar Ayuda (.HLP) en la Ayuda de Delphi? MasterXP Varios 6 12-04-2006 07:57:49
Ayuda para crear ayuda... Gabriel2 Varios 2 10-06-2005 01:15:18
ayuda con strtofloat, ayuda punto flotante TURING Varios 5 30-04-2004 09:03:59
Ayuda Con Instalacion De Archivos De Ayuda Legolas Varios 1 01-12-2003 15:48:03


La franja horaria es GMT +2. Ahora son las 15:04:32.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi