Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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??


in reply to how to program my program to add random numbers?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://918810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-03-19 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found