All pastes #638640 Raw Edit

Someone

public text v1 · immutable
#638640 ·published 2007-07-30 00:05 UTC
rendered paste body
#!/usr/local/usr/perl
warnings;
strict;
print("\nWelcome to FiendishFish's Simple Perl Calculator.\nTo use this program, just follow the instructions.\n");
print("\nPlease enter the first number for your mathematical calculation:\n");
$num1 = <STDIN>;
chomp ($num1);

print ("\n\nNow enter the second number for your mathematical calculation:\n");
$num2 = <STDIN>;
chomp ($num2);

print ("\n\nWould you like to add, multiply, subtract or divide these numbers?\n");
$maths = <STDIN>;
chomp ($maths);

if ($maths eq 'add','Add')
{
	print ("\n\n");
	print("Your answer is: ","$num1" + "$num2");
	print ("\n\n");
}

elsif ($maths eq 'multiply','Multiply','mult','x','X')
{
	print ("\n\n");
	print("Your answer is: ","$num1" * "$num2");
	print ("\n\n");
}

elsif ($maths eq 'subtract','noob')
{
	print ("\n\n");
	print("Your answer is: ","$num1" - "$num2");
	print ("\n\n");
	
}

elsif ($maths eq 'divide')
{
	print ("\n\n");
	print("Your answer is: ","$num1" / "$num2");
	print ("\n\n");
}

else
{
print ("\n\nInvalid Mathematical Operator\n\n");
}

print("Program Complete...Closing\n\n");
<STDIN>;