I am trying to make a script that if you type in - it does subtraction if i type in * it does multiplication so far I have
#!/usr/bin/perl print "What is your name?\n"; $name = <>; chomp($name); $greeting = "Hello, " . $name . "\nWhat do type of math do you want th +is program to do?\n"; print $greeting; print "What is the first number?\n"; $a = <>; chomp($a); print "What is the second number?\n"; $b = <>; chomp($b); print "Here is the answer\n"; $c = $a - $b; print $c; print "\nTada\n"; exit();
what need I add ?
Thank thee for thine wisdom
20031024 Edit by Corion: Added formatting
BazB: title changed as suggested.
In reply to Help with simple calculator script. by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |