and it happens to be..................*cough*....................*ah em*..............................*ack*............ .
and it happens to be..................*cough*....................*ah em*..............................*ack*............ .
Wow, instead of just typing it into google and getting the result immediately, you are persistent and ask as long as you don't get an answer ... try sqrt().
ok thanks i get the point, ill research stuff first next time
thanks for the help, and i thought id post another project i finished, this one solves quadratics
my only problem with it is that i cant keep numbers as fractions, oh well!Code:#include <cstdlib> #include <iostream> #include <math.h> using namespace std; int main(int argc, char *argv[]) { int e; e = 1; while (e == 1) { float a; float b; float c; float x; float w; float q; cout << "A = _"; cin >> a; cout << "B = _"; cin >> b; cout << "C = _"; cin >> c; system("echo Positve Answer"); w = (-b + sqrt (pow (b,2) - 4 * a * c)); q = (w / (2*a)); cout << q; system("echo ."); system("PAUSE"); system("echo Negative Answer"); w = (-b + sqrt (pow (b,2) - 4 * a * c)*-1); q = (w / (2*a)); cout << q; system("echo ."); system("pause"); cout << "Enter 1 to solve another one!"; cin >> e; } return EXIT_SUCCESS; }
Now try to code it so that it deals with imaginary numbers and also can give you an exact solution instead of the approximate. I did the same thing with my graphing calculator, but the teacher gives out a similar program with less functionality than mine. Either way I'm sure no one would pay for it and it pains me to see that you want to sell it especially when it's such a tiny program.
My computer is awesome.