This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - ruler501
Pages: 1 ... 175 176 [177] 178 179 ... 184
2641
« on: January 22, 2011, 04:40:01 pm »
Norton is telling me its a virus
does anyone know a way I might be able to get it working?
2642
« on: January 22, 2011, 04:22:11 pm »
It responds 5 is 0 in base 5 with this code EDIT: I changed rem to start with the value of num it now says five is 1 in base 2 and 50 is 0 in base 2
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { int product, power; float num, rem; double answer, base, conv=1, ten, place; power = 0; ten = 0; answer = 0; cout << "Enter number to be converted "; cin >> num; cout << "\n"; cout << "What base do you want to put it in "; cin >> base; cout << "\n"; rem = num; while(base>10) { cout << "please put in a smaller base "; cin >> base; cout << "\n"; } while(conv<=num) { power++; conv=conv*base; } while(rem!=0) { power--; conv=pow(base, power); place = pow(ten, power); product = floor(rem/conv); while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(power<=-20) { break; } } cout << "Your answer is " << answer <<"\n"; cout << "\n"; system("PAUSE"); }
2643
« on: January 22, 2011, 03:12:11 pm »
I like it better just it doesn't work
[rant]I JUST WANT TO USE A GOOD PROGRAM[/rant]
It doesn't display an answer here's my newest code
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { int product, power; float num, rem; double answer, base, conv=1, ten, place; power = 0; rem = 0; ten = 0; answer = 0; cout << "Enter number to be converted "; cin >> num; cout << "\n"; cout << "What base do you want to put it in "; cin >> base; cout << "\n"; while(base>10) { cout << "please put in a smaller base "; cin >> base; cout << "\n"; } while(conv<=num) { power++; conv=conv*base; } while(rem!=0) { power--; conv=pow(base, power); place = pow(ten, power); product = floor(rem/conv); while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(power<=-20) { break; } } cout << "Your answer is", answer; cout << "\n"; system("PAUSE"); }
2644
« on: January 22, 2011, 02:35:15 pm »
EDIT: I rewrote some of it and still get some errors and cause this to happen when I run the program
Enter number to be converted 50//the 50 is what I put in What base do you want to put it in 5//the 5 is what I put in
It then leaves the cursor on the next line and runs forever without showing anything this is my code:
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { int product, power; float num, rem; double answer, base, conv=1, ten, place; cout << "Enter number to be converted "; cin >> num; cout << "\n"; cout << "What base do you want to put it in "; cin >> base; cout << "\n"; while(base>10) { cout << "please put in a smaller base "; cin >> base; cout << "\n"; } while(conv<=num) { power++; conv=conv*base; } while(rem!=0) { power--; conv=pow(base, power); place = pow(ten, power); product = floor(rem/conv); while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(power<=-20) { break; } } cout << "Your answer is", answer; }
2645
« on: January 22, 2011, 02:17:56 pm »
more code should work now
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { int product, power; float num, rem, conv=1, place; double answer, base, ten; cout << "Enter number to be converted"; cin >> num; cout << "\n"; cout << "What base do you want to put it in"; cin >> base; cout << "\n"; while(base>10) { cout << "please put in a smaller number"; cin >> base; cout << "\n"; } while(conv<num) { power++; conv=conv*base; } while(rem!=0) { power--; conv=pow(base, power); place = pow(ten, power); product = rem/conv; while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(rem<0) { answer -= product*place; rem += product*conv; break; } } }
compiler still not working can't find it gnu gcc doesn't work
2646
« on: January 22, 2011, 12:58:58 pm »
Here is my new code
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std;
int main() { int product, power; float num, base, rem, conv=1, place; double answer; cout << "Enter number to be converted"; cin >> num; cout << "What base do you want to put it in"; cin >> base; while(base>10) { cout << "please put in a smaller number"; cin >> base; } while(conv<num) { power++; conv=conv*base; } while(rem!=0) { power-=1; conv=base^power; place = 10^power; product = rem/conv; while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(rem<0) { answer -= product*place; rem += product*conv; break; } } }
How to you raise a number to an exponent in C++?
EDIT: the includes are what my book said to do
EDIT 2 what is a good compiler to use?
2647
« on: January 22, 2011, 12:18:48 pm »
OK I'll try that Did you see any problems with the code?
EDIT: You were right The path doesn't exist
2648
« on: January 22, 2011, 12:07:53 pm »
I am working on my first real C++ Project a base to base converter that will work with all real numbers 36 and other. This is the beginning of my code. currently it should only supports numbers from 1 to 10
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { int product, power; float num, rem; double answer, base, conv=1, ten, place; power = 0; ten = 10.0; answer = 0; cout << "Enter number to be converted "; cin >> num; cout << "\n"; cout << "What base do you want to put it in "; cin >> base; cout << "\n"; rem = num; while(base>10) { cout << "please put in a smaller base "; cin >> base; cout << "\n"; } while(conv<=num) { power++; conv=conv*base; } while(rem!=0) { power--; conv=pow(base, power); place = pow(ten, power); product = floor(rem/conv); while(product >= base) { product-=1; } answer += product*place; rem -= product*conv; if(power<=-20) { break; } } cout << "Your answer is " << answer <<"\n"; cout << "\n"; system("PAUSE"); }
I'm using codeblocks with the gnu gcc compiler it returns this error when I try to compile please help
"B2B - Release" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping... Nothing to be done. EDIT: I am now using Microsoft Visual C++ Express 2010 and have a succesful beta build which I have attached here. Updated my code above EDIT2:Here is the code for my Quadratic Solver
#include <cstdlib> #include <iostream> #include <math.h> using namespace std;
int main() { float bs, cs, s, ra, rb, a, b, c, h, k; cout << "What is a? "; cin >> a; cout << "What is b? "; cin >> b; cout << "\n"; cout << "What is c? "; cin >> c; cout << "\n"; bs = b/a; cs = -1*c/a+pow(bs, 2)/4; s = sqrt(cs); ra = bs/2+s; rb = bs/2-s; h=bs/2; k=a*pow(bs, 2)/4+c; cout << "The First Root is" << ra << "\n"; cout << "the Second Root is" << rb << "\n"; cout << "Vertex is (" << h << "," << k << ")" << "\n"; system("Pause"); } I attached the .exe for this also
2649
« on: January 22, 2011, 11:31:48 am »
what are perfect numbers again I forgot
2650
« on: January 21, 2011, 07:03:19 pm »
wish I had known that I've been bug checking so much... Wonder what the next question will be???
2651
« on: January 20, 2011, 10:09:38 pm »
2652
« on: January 20, 2011, 09:37:54 pm »
what pph is the acid? and is it called a controlled substance in the US?
EDIT: I meant ph not pph
2653
« on: January 20, 2011, 09:30:22 pm »
I thought that was a bug in my program I didn't get any either. graphmastur are there any under 1000 if not how high do we need to set the upper limit
2654
« on: January 20, 2011, 09:27:37 pm »
i'm working just not having much time trying to learn C++ and my compiler won't work so reinstalling it and my IDE. Have Algebra work and English Homework I'm making a little headway should be done soon if I have time to work on it
2655
« on: January 20, 2011, 09:11:45 pm »
Can I do this with a 2.0 OS Nspire? Do I need to do anything differently?
Pages: 1 ... 175 176 [177] 178 179 ... 184
|