Sandstorm
2009-01-11 14:26:36
I actually made these because I didn't feel like doing my own homework, but yea xD.
Pythagorean's theorom:
X and Y are the two numbers your supplied. C is whether you want to find C or Not.
Slope:
Obvious. It actually asks the questions backwards for some reason xD.
I don't know if these have already been made, but I figured I'd post them in case anyone wanted them.
~Sandstorm
Pythagorean's theorom:
Program New;
Function Pythag(X, Y : Integer; C : Boolean) : Extended;
Begin
Case C Of
False : Result := Sqrt((X*X) + (Y*Y));
True : Result := Sqrt((Y*Y) - (X*X));
End;
End;
Begin
WriteLn(FloatToStr(Pythag(40, 50, true)));
End.X and Y are the two numbers your supplied. C is whether you want to find C or Not.
Slope:
Program New;
Function Slope(x1, y1, x2, y2 : Integer) : String;
Var
X3, Y3 : Integer;
begin
X3 := X1 - X2;
Y3 := Y1 - Y2;
Result := IntToStr(Y3) + '/' + IntToStr(X3);
WriteLN(Result);
end;
Begin
Slope(strtoint(ReadLn('What is X1?')), strtoint(ReadLn('What is Y1?')), strtoint(ReadLn('What is X2?')), strtoint(ReadLn('What is Y2?')));
End.Obvious. It actually asks the questions backwards for some reason xD.
I don't know if these have already been made, but I figured I'd post them in case anyone wanted them.
~Sandstorm