PDA

View Full Version : Mono, C#, Calculator



matmatmat
May 9th, 2009, 01:48 PM
How can I evaluate sums eg:


(10+5)*(1+2)

and get it to equal 45, is there a libary/function/class/thing to do this?

directhex
May 9th, 2009, 04:34 PM
http://www.codeproject.com/KB/dotnet/Expr.aspx

matmatmat
May 9th, 2009, 05:14 PM
Where do you unzip it?

dwhitney67
May 9th, 2009, 06:24 PM
How can I evaluate sums eg:


(10+5)*(1+2)

and get it to equal 45, is there a libary/function/class/thing to do this?
Is this for a class that you are taking? If so, perhaps the point of the exercise is for you to develop a stack container, then translate the expression into postfix notation, and from here, compute the result.

matmatmat
May 10th, 2009, 08:45 AM
It isn't for a class, I'm just thinking of doing a calculator and wondering if there was an easy way to do the sums.

matmatmat
May 12th, 2009, 03:41 PM
bump?

directhex
May 12th, 2009, 04:34 PM
bump?

You've been linked to an implementation complete with source. What more do you need?

matmatmat
May 12th, 2009, 04:55 PM
Where do you unzip it?

& How do you use it?

kjohansen
May 12th, 2009, 05:03 PM
You have to signup for codeproject to download files.

The src of an example use is on the site...

matmatmat
May 12th, 2009, 05:04 PM
I have downloaded it, do I just unzip it in my project directory?

directhex
May 12th, 2009, 07:06 PM
I have downloaded it, do I just unzip it in my project directory?

Sorry, but I think there are reasonable assumptions to be made about free code - one of those assumptions is "can look at code and work out how best to use it in your project"

I have NO idea what your project folder looks like, nor how best to lay out a helper library in whatever IDE you're using. No idea at all. This is the kind of thing you're meant to be able to do yourself if you're writing code - at least, I dunno, look inside the Zip file and determine the shape of what's inside