Forum: C++ Jun 4th, 2009 |
| Replies: 11 Views: 441 well a map is going to associate a key with a value, so if you set your keys to your planet names and the values to your objects (planets), you can retrieve them based on the name (key). |
Forum: C++ Jun 4th, 2009 |
| Replies: 11 Views: 441 what are you trying to do?
input.moons would mean you are trying to get the moons of a string... |
Forum: C++ Nov 9th, 2007 |
| Replies: 12 Views: 7,117 cout << table[row][column];
Are you sure this is what you want to be doing?
In regard to implementing the random integers, you can just assign them as you print that particular cell. So add... |
Forum: C++ Oct 15th, 2007 |
| Replies: 7 Views: 2,859 I appologise about the ^2, you are correct here. I assume those "2"s are supposed to be in superscript :). Anyway I felt nice so:
#include <iostream>
#include <iomanip>
#include <cmath>
... |
Forum: C++ Oct 15th, 2007 |
| Replies: 7 Views: 2,859 pi = sqrt(6* (1/(1)2 + 1/(2)2 + 1/(3)2+ 1/(4)2 + 1/(5)2 +...... + 1/(n)2))
Ok, so looking at this equation you have the series of summing 1/(n)2 . This is not equivalent to the sum of 1/(n^2).
... |
Forum: C++ Oct 15th, 2007 |
| Replies: 7 Views: 2,859 for (count =1; count <= terms; count++);
This pretty makes your loop useless, you don't want that semi-colon.
You also need to check the logic behind the steps you take to calculate pi. E.g. I... |