The program must give 5 when written (2-3)*5+10.

I know something about regular expressions, but not much. That's why I prefer, for example some functions:

double number(char* c)

double name(char*c)

ect.]]>

I think a "regular expression" would handle this - regular expressions are included in php, java, and .net

]]><function>::=<name>(<set_of_arguments>);

<name>::=<letter>|<letter><name>;

<letter>::=a|b|c|d|...|z;

<set_of_arguments>::=<argument>|<set_of_arguments><argument>;

<argument>::=<number>|<function>;

<number>::=<digit>|<number><digit>;

<digit>::=0|1|2|3|4|5|6|7|8|9;

Can someone help me?

(I accept C code)

(but if n and i are from some class with predefined operator*, operator/ and operator= , it may be something)

]]>

`if (n*i)/i = n`

What a pointless statement! God knows why it's there :S

P.S. liuv, it is I who added you on MSN!

]]>]]>

And for the C - isn't there something as CScript, which is close to C?

Anyway, javascript is very close to C.]]>

I downloaded and had a brief look at your code. It is a start! A lot more to do I think

But the trouble with "C" is that it isn't good for websites. Super-excellent for speed, though. I have done things in C that run 100 times faster than javascript. Seriously! A fraction of a second compared to nearly a minute. A minute is a long time to wait, and you wonder how javascript could be so innefficient.

Anyway, C can be translated to javascript, or actionscript for flash, or even php, reasonably easy, so long as you steer clear of things like pointers and objects. And then hopefully speed is not an issue.

So, when you come up with some code you would like to test on the website, post it here and I will have a go.

]]>3(x-2)(x-2) + x - 6

(3x-6)(x-2) + x - 6

3x^2 - 12x + 12 + x - 6

3x^2 - 11x + 6

(3x - 2)(x - 3)

P.S. My algebra drags.

]]>Be Warned! The code is very messy.

http://www.philoswald.f2s.com/maths1.rar

You'll need to run them from a command line rather than double clicking on the executable or you wont get to read the last line.]]>

I'm a bit stuck at the moment on the following for now:

factorise 3(x-2)^2 + x - 6

(3x - 6)^2 + x - 6

(3x - 6)(3x - 6) + x - 6

9x^2 - 36x + 36 + x - 6

9x^2 - 35x + 30

I've tried trial and error to put

-1, -30

-2, -15

-3, -10

-5, -6

into both

(3x )(3x )

(9x )(x )

But cannot for the life of me work it out!

]]>More details?

]]>I'm going to write some apps that will generate questions of choise, would mathsisfun be interested in having these apps?

]]>http://www.coursework.info/65/index.html]]>