Side lenght - area - combinations calculator. Help needed

Hello, everyone. I'm writing a program which finds all possible side lengths of quadrangle to match specified area.
I've checked the code - everything works, except the part (it's in bold), where the program has to write matching pair of quadrangle side lengths.

program Area;
var x, y, S, n: real;
begin
WriteLn('Enter quadrangle area:');
ReadLn(S);
WriteLn('Enter accuracy:');
ReadLn(n);
x:=n; y:=n;
WriteLn;
WriteLn('Calculating possible lenghts of quadrangle sides...');
While (xy<>S) and (y<=(S/n)) and (x<=S) do begin
If x+n<=S then
x:=x+n
else begin
x:=n;
y:=y+n;
End;
** If x
y=S then
WriteLn(x:0:2,' ; ', y:0:2);**
End;
WriteLn;
WriteLn('Calculation has been finished.');
ReadLn;
end.

What's wrong there? Could be a compiler bug or something other?

Comments

  • program Area; var x, y, S, n: real; begin WriteLn('Enter quadrangle area:'); ReadLn(S); WriteLn('Enter accuracy:'); ReadLn(n); x:=n; y:=n; WriteLn; WriteLn('Calculating possible lenghts of quadrangle sides...'); While (xy<>S) and (y<=(S/n)) and (x<=S) do begin If x+n<=S then x:=x+n else begin x:=n; y:=y+n; End; ** If xy=S then WriteLn(x:0:2,' ; ', y:0:2);** End; WriteLn; WriteLn('Calculation has been finished.'); ReadLn; end.

  • Hello great programmers.. is there any categpry here for out the box thing, something natural.. something linked to painting???
    If want something real,., visit "remediosvaro.biz", or stay here.. involved ikn programming, gud luck . ..

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories