Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1575
  • Last Modified:

Polynomial in C++

I have problem with polynomial. A program witten by C++
input : 2+3^2+4^6*10+sin30-cos45+........
output: result of polynomial

can send to me the code ? send to vhm1985@yahoo.com
thanks
0
kolosoxu
Asked:
kolosoxu
1 Solution
 
Jose ParrotGraphics ExpertCommented:
Hello, kolosuxu,

It is against ee rules to post emails to direct communications. Also we can't send answers directly: all the answers are to be post here, in the same way I'm writing this now.

About the question, it is not a trivial one. You need a parser to read the string and capable of understanding ASCII codes for numbers, math signs (+ - * ^), trigronometric entities (sin, cos), capable also of execute the calculations under rules of precedence (first ^, then * and /, then + and -). This a good sizing program.

Your may want try the code at
http://www.eleves.ens.fr/home/ollivier/mathlib/mathexpr.html

Jose
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now