The problem is I can't get the denominator to increase as I attempt to add them.
Anyone care to point out my most likely obvious mistake?
This is what I have
#include <iostream>
using namespace std;
void main ()
{
const long MaxNum (100);
double i;
double Sum;
double x;
for (x = 1, i = 1/1, Sum = 0; x <= MaxNum; x++)
Sum += i;
cout << "Sum is " << Sum << endl;
}
That code is pathetic, even for someone who's never programmed before. It's impressive when the least of its problems is that it's in Sepples.
Start over.
>>7 ENTERPRISE programmers don't program like that. Only faggots trying to be clever do that.
Name:
Anonymous2010-09-24 7:43
ENTERPRISE PRODUCTION PSEUDOCODE
public class PerformOperation {
EnterpriseRealNumber ReallyPerform() {
EnterpriseRealNumber ernSum = new EnterpriseRealNumber(0);
EnterpriseRealNumber ernX = new EnterpriseRealNumber(1);
EnterpriseRealNumber ernMaxNum;
ernMaxNum = MaximumNumberForOperationSingletonPattern.getInstance().getMaximumNumberForOperation(new OperationConfirmer(new EnterpriseBoolean(1));
for (new EnterpriseDummyValue(); ernX.comparesLessOrEqualsTo(ernMaxNum); ernX.performNumericOperation(new NumericOperation(new OperationIncrementDescriptor(new EnterpriseRealNumber(1))))) {
ernSum.performNumericOperation(new NumericOperation(new OperationAdditionDescriptor(new EnterpriseRealNumber(1).performNumericOperation(new NumericOperation(new OperationDivisionDescriptor(ernX))))));
}
return ernSum;
}
}
Name:
Anonymous2010-09-24 10:14
>>7
The only reason to use a break or continue statement is if you really can't guarantee contents or the duration of a loop iteration. On the other hand, encountering a situation like this suggests you might reconsider how you are trying to accomplish what you are doing.
my @denom=1..100; my @results = 1 <</>> @denom; say [+]@results;
try.rakudo.org
Name:
Anonymous2010-09-24 11:41
C++ PROGRAMMERS ARE ALL RETARDS. I HATE C++ PROGRAMMERS SO MUCH. I LOL AT HOW THEY MAKE THINGS PRIVATE IN CLASSES BUT THEY ARE CLASSES THAT THEY ARE JUST USING THEMSELVES. STOP BEING A FAG. DONT THEY TRUST THEMSELVES>??? OOOOH IVE GOT TO PROTECT THE VARIABLSE.
FUCK U C++. I AM A SUPER COOL PROGRAMMER AND I CAN HANDLE HAVING ACCESS TO EVERYTHING I AM USING. IF IM NOT MEANT TO USE IT, I WONT. IM NOT SOME FAG THAT CANT BE TRUSTED AND HAVE TO HAVE THE PRIVACY ENFORCED. ENJOY YOUR WASTED HOURS WRITING GET AND SET METHODS FAG WHILE IM WRITING AMAZING CODE AND HAVING SEX WITH MODELS AND SNORTING COCAINE OFF THEIR TITS.
>>13,15-19
It may be an old troll, but as a C++ asshole, I have to admit that this thought crosses my mind pretty often.
"Ok, why am I making this private again? Am I afraid I'll accidentally become an idiot in the near future?"
And if I did decide that I really needed to touch that forbidden piece of data, would private really stop me? Wouldn't a comment along the lines of
// Hey shithead, this is internal state that gets updated by this other method over here, so why don't you call that instead?
be more helpful?