more useful options | |
PerlMonks |
Re: how to program my program to add random numbers?by zek152 (Pilgrim) |
on Aug 05, 2011 at 15:47 UTC ( [id://918810]=note: print w/replies, xml ) | Need Help?? |
Can you be a little more clear about what the teacher was unhappy about? You don't have to have the $z = $x +|-|*|/ $y;. You can do the calculation in the print statement ({print "$x + $y = " . $x + $y . "\n";) and then you can remove the inefficient 3 checks (if the user entered "Add" it will still check to see if he entered sub,mult,div). Those should be elsifs. This is all speculation as I can't read your teacher's mind. Hope this helps a little.
In Section
Seekers of Perl Wisdom
|
|