Answer to Question #23664 in C++ for Richard

Question #23664
Hello , i have a task from the university , i have to make a calculator in c++ which calculate the analitic derivative of a function ( i have solved this point) , and after this task is completed complete another task which is the following.
The user input a function from the keyboard.
I store it in an array of chars, and lets say the user enters this function : f(x) = x^3*5+5
I have to calculate the value of that function in a point , for example if x=5 my function should return the value of f(5) , the problem is that i dont know how to pass the function f(x) from an array of chars to an array of integers in order to be able to actually compute the result. What i tought its that i take every operation and make an if for everyone , lets say i take a for loop and if i find the simbol function[i]= '*' the program must calculate the multiplication of the function[i-1] * function[i+1] , but this thing gets TOO much time ,and i really think there must be another way of doing it. How can i pass the function ??
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS