Oh ok.. Thanks for that chomp function, really makes it easier to read the output.
Yeah, I just multiplied $yvpxxs by -1.
Now it's:
#!/usr/bin/perl
use warnings;
use strict;
print "You can solve the y-y=m(x-x) equation with this program. \n";
print "Enter y variable. \n";
my $yval = [STDIN];
print "Enter slope. \n";
my $slpe = [STDIN];
print "Enter x variable. \n";
my $xval = [STDIN];
chomp ($yval, $slpe, $xval);
my $xvxsl= $xval * $slpe ;
my $yvpxxs= $yval + $xvxsl *-1 ;
print "Step one: y-$yval=$slpe x-$xvxsl \n";
print "Step two: y-$yval+$yval=$slpe x-$yvpxxs \n";
print "Answer: y= $slpe x-$yvpxxs \n";
|