An simple code for calculating area of some geometric shapes, but hwn i added goto function to repeat the program error appeared. "Error 85: ";" Expected and it points to the last line of the code where end. is. No idea what could it be. This error usually appears when u forget to put ; somewhere but seems that's not the case :S<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->program intpro;<br />uses crt;<br />VAR A,B,C,D,E,F,G,OPTION,R,P,menu,H,S,V,AC:REAL;<br />label one;<br />BEGIN<br />TextColor(10);<br />TextbackGround(8);<br />clrscr;<br />writeln ('This is a geometric shapes calculator, press any number for menu');<br />readln(menu);<br />one:<br />Writeln ('1. Cone calculations');<br />Writeln ('2. Sphere calculations');<br />Writeln ('3. Cube calculations');<br />Writeln ('4. Parallelogram calculations');<br />Writeln ('5. Cylinder calculations');<br />writeln ('6. Pyramid calculations');<br />readln (option);<br />if OPTION = 1 then begin;<br />writeln ('To calculate the area of the cone give me cones diameter and volume ');<br />write ('Diamter:');<br />read (D);<br />write ('Volume:');<br />readln (V);<br />R:=D/2;<br />H:=(3*V)/(R*R*3.14);<br />S:=SQRT(H*H+R*R);<br />AC:=(R*R)*3.14+R*S*3.14;<br />Write ('The area of this Cone is ');<br />write (AC:0:1);<br />write (' cm2 ');<br />readln;<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />if OPTION = 2 then begin;<br />writeln ('To calculate the area of the sphere enter the diameter');<br />write ('Diamter:');<br />readln (D);<br />R:=D/2;<br />A:=4*3.14*(R*R);<br />write ('The area of this sphere is ');<br />write (A:0:1);<br />write (' cm2 ');<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />If option = 3 then begin;<br />writeln ('To calculate the area of the cube, insert its side "a"');<br />write ('Diameter:');<br />readln (A);<br />P:=6*(A*A);<br />Write ('The area of this cube is ');<br />write (P:0:1);<br />write (' cm2 ');<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />END;<br />if option = 4 then begin;<br />writeln ('To calculate parallelograms area insert its side a, side b and volume');<br />write ('SIDE A:');<br />read (A);<br />write ('SIDE B:');<br />read (B);<br />write ('VOLUME:');<br />readln (V);<br />C:=V/(A*B);<br />P:=2*(A*B+A*C+B*C);<br />write ('The area of this parallelogram ');<br />write (P:0:1);<br />writeln (' cm2 ');<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />end;<br />If option = 5 then begin;<br />writeln ('To calculate Cylinders area insert its diameter and volume');<br />write ('DIAMETER:');<br />read (D);<br />write ('VOLUME:');<br />readln (V);<br />R:=D/2;<br />H:=V/(R*R*3.14);<br />A:=2*R*3.14*(R+H);<br />write ('The are of this cylinder is ');<br />write (A:0:1);<br />writeln (' cm2 ');<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />end;<br />if option = 6 then begin<br />writeln ('To calculate four sided pyramids area enter its base and volume');<br />write ('BASE:');<br />read (B);<br />write ('VOLUME:');<br />readln (V);<br />A:=sqrt(B);<br />H:=(3*V)/(A*A);<br />P:=2*A*H+A*A;<br />write ('The area of this four sided pyramid is ');<br />write (P:0:1);<br />writeln (' cm2 ');<br />writeln('');<br />writeln ('For menu press 1, to exit press 2');<br />readln (menu);<br />if menu = 1 then goto one;<br />if menu = 2 then;<br />end;<br />end.    <!--c2--></div><!--ec2--><br /><br /><br />compiler says that the error is in the last line and points on the dot<br /><br /><span class='edit'>This post has been edited by <b>rehab</b>: 15 Oct, 2007 - 02:16 PM</span>
</div>
</div>