0

Hey, I posted earlier about arbitrary expressions and I did find solution to that. The question is how do I create random expressions? So far I've created codes to generate random operators and random numbers, how will I generate random expressions?

E.g. a1,a2,a3 are variables for random numbers I've assigned int r to generate random operators using switch statements.

How do I put this theory onto code exactly?

Thanks

4
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by JamesCherrill
0

Can you give some examples of the type of expressions you are looking for.
A technique for getting random operators would be to put them into an array and use a random number generator for selecting the operator.

0

It's okay mate, I've figured it out and submitted my coursework.

Thanks anyway =)

0

Welcome to DaniWeb, and thanks for the sample code. Presumably you noticed that the OP "figured it out and submitted his homework" 10 months ago, so it's a bit late to help him!
For future reference, if you are publishing code here, please do not link to an external site (was that your own site?). Include the code in your own post, formatted as code by using the "code" button above the edit area.
Thanks
J

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.