QuestionSolving For X (Console Math)

Posts 18 of 8 · Page 1 of 1
Solving For X (Console Math)
Okay so I know practically nothing about creating mathematical applications in C++ but am trying to learn. Practically everything I search for isn't anything close to what I need. Basically, I need to lean how to make a calculator style app first before continuing on, however I can't find anyone to teach me. Then to top it off, I then need to step it up to where the app can solve complex expressions and equations. When I say complex I'm meaning basic algebra. Not too hard to do, still harder than basic math.

My main concern is polynomials because they are the most interesting to me. I need the user to be able to type in a complete polynomial and the application to solve it with or without the variable assignments.

Example:
// Please note I don't know how to do powers so if a number is an exponent it will have ^ before it.
a = (3x^2 − 4x + 8) + (2x^2 + 5x −12);

This simplifies to a = (5x^2 + x - 4).

The application would have to simplify the problem given. The next example x is given. I want the application to scan the user input for the variables and ask if they have given values. (This is if the user isn't smart enough to exchange them already.

x = 4;
a = (3x^2 − 4x + 8) + (2x^2 + 5x −12)
a = (5x^2 + x - 4)

Simplify;

a = (5 * 4^2 + 4 - 4)
a = (5 * 16 + 4 - 4)
a = (80 + 4 - 4)
a = (84 - 4)
a = 80;

So that's all the information I really have, I just want to learn this, so anyone willing to teach me would be awesome. You would have eternal thanks. (Oh and sorry if the step by step bugs you, it's just a habit of mine. I kind of want the application to show the steps as well.)

Code:
#include <iostream>

using namespace std;

int main()
{
system("pause")
return 0;
}
// Talk about starting from scratch.

~SeptFicelle
Read my pm I sent you, I might be able to help.
OooOOoo your a Coder Chick
But @topic no ones going to teach. The best thing i can tell you is to be independent
Completely unhelpful... Please just message me next time instead of posting something of no use. Sorry.

~SeptFicelle
String manipulation? o_O
Are you trying to set up a problem where you can have X represent something or to where it solves for x
HELPFUL POST:

You will need to use string find, to get the location of everything.

Then combine that with Newton's Method or as why06 said Wolfram
Posts 18 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?