Jump to content

Archive:Turbo Pascal help: Difference between revisions

From IdeaWazaWiki
wikademia>Wikademia
m 8 revisions
wikademia>Wikademia
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page is dedicated to helping Turbo Pascal 7 or 3.1 (for Windows) Programmers.
This page is dedicated to helping Turbo Pascal 7 or 3.1 (for Windows) Programmers.
To post questions, just go into edit and post them.
To post questions, just go into edit and post them.
They will be answered.
They will be answered.
Click on the link below to go to my page and edit and paste the questions there or edit and paste your questions here.
[[User:Drnoitall.hello|Drnoitall.hello]] 02:52, 20 March 2007 (UTC)Drnoitall.hello


----
----

Latest revision as of 09:05, 12 June 2009

This page is dedicated to helping Turbo Pascal 7 or 3.1 (for Windows) Programmers. To post questions, just go into edit and post them.

They will be answered.


Questions Here: i wrote this program for my programmin class and i cannot figure out why i keep receiving the same error message i get the error 4 duplicate identifier for the variable "triangle" which is a string.

program triangle;

uses crt;

const skip=' ';

var side1:integer; side2:integer; side3:integer; triangle:string;

begin

  clrscr;
  writeln('Enter first side: ');
  readln(side1);
  writeln('Enter second side: ');
  readln(side2);
  writeln('Enter longest side(if applicable): ');
  readln(side3);
  if (side1=side2) or (side2=side3) or (side1=side3) then
  triangle:='isosceles'
  else
      if (side1<>side2) and (side2<>side3) and (side3<>side1) then
      triangle:='scalene'
      else
          if (side1=side2) and (side2=side3) then
          triangle:='equilateral';
  writeln('The triangle is ',traingle);
  if (triangle='isosceles') and (sqr(side1)+sqr(side2)=sqr(side3)) then
  writeln('The triangle is also a right triangle.')
  else
      writeln('The triangle is not a right triangle.');
  if (triangle='scalene') and (sqr(side1)+sqr(side2)=sqr(side3)) then
  writeln('the triangle is also a right triangle.')
  else
      writeln('the triangle is not a right triangle.');
  readln;

end. (The preceding unsigned comment was added by 98.196.206.181 (talk • contribs) 22:19, 23 October 2007.)