[perl] Solving an algebraic equation
Hi, im a complete no0b at Perl, but I attempted to write a program that can solve the y-y=m(x-x) equation (forgot what its called).
Here it is:
#!/usr/bin/perl
use warnings;
use strict;
print "You solve the y-y=m(x-x) equation with this program. \n";
print "Enter y variable. \n";
my $cot = [STDIN];
print "Enter slope. \n";
my $hot = [STDIN];
print "Enter x variable. \n";
my $pot = [STDIN];
print "y-$cot=$hot(x-$pot) \n";
So, when I execute it, it works, no errors,
I enter the slope and stuff, but it doesnt solve the equation. It's like:
y-4
=2.5
(x-1
)
What could be the problem?
Edit: After the variables there should be the STDIN tag thing.
Last edited by VF19; 01-24-2004 at 01:53 PM..
|