HardQuor's forum posts

Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#1 HardQuor
Member since 2007 • 1282 Posts

[QUOTE="foxhound_fox"]The basis of atheism is a lack of belief entirely. If one is an agnostic atheist, they don't actually "believe" anything... and most atheists are agnostic.

Some atheists criticize fundamentalist Christians for trying to mix their beliefs with science and claiming that their beliefs are "true" in the sense of scientific proof and not just true based on faith.NTWrightfan

that really does not answer my question, where does the responsibility to hold to true beliefs come from?

From logic. If we hold anything true that cannot be proven through logic, reason, or through our senses, then anything can be held true.

and from whence cometh the responsibility to not mix religious dogma with scientific processes?

NTWrightfan
Our responsibility to ourselves, for self-preservation and self-interest.
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#2 HardQuor
Member since 2007 • 1282 Posts
weird, glitchspot doesn't want to let me edit my posts. Anyways, I probably should have known to always initialize my variables, but it was so long ago that i last read a C++ book, that i'm going on memory alone. At least now i'm learning through application instead of just reading. Can't afford a programming class at this point :(
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#3 HardQuor
Member since 2007 • 1282 Posts
[QUOTE="HardQuor"]I've never gotten my code to get that output.. I'm guessing that's probably right, but i don't want to put it in until i can get my code to back it up.

---edit---
aha! i found out what the problem is, by doing what you did, i just had it output term3 at the end of each do..while loop. aaand, it turns out that it's going one step over the 4 million mark for some reason.. gotta figure that out, now.

---re-edit---
nope, I was wrong again, i was actually reading a list of all thefibonacci sequence numbers, not the ones that were being totalled. So now i'm just totally confused, because when i checked the numbers being added together, it was all the rightones, and like you, i added them together manually to get the same sum that you got. But for some reason, my code is coming up with an extra 53410852 somewhere.

---re-re-edit---
OK! I FINALLY figured it out. Turns out that if i don't initialize a long integer, it defines itself as 53410852. So i went ahead and initialized it with a value of 0 and got our 4 million-ish number :lol: I knew from reading some books on C++ that it would be finicky, but JEEZ.

OrkHammer007

Edit #1- It will come up with the extra 5+ million because of the loop. The value before that one is just shy of the 4 million condition you set; therefore, you will get the extra iteration. Fortunately, it's an odd value, which fails the if... test in the loop.

Edit #3: One of the first rules we learned in programming (whether it was C++ or Java or Visual Basic) was to always initialize a variable. There are some instances where a "null" value is needed, but even then, we were told to intialize it as a "null."

Did the initialization solve your problem?

yup! that 4million number was the correct answer, thankfully. Now i'm moving on up to problem 6. I haven't done 3-5 yet, as i'm doing them in the order of the number of people who have completed them succesfully. Apparently problem 6 is easier than 3-5.
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#4 HardQuor
Member since 2007 • 1282 Posts
Sounds like you broke up but without any closure. Talk to her, not to make up or anything, but to get some peace of mind.
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#5 HardQuor
Member since 2007 • 1282 Posts
I'm siding with Clerks 2.

It's actually funny, I was going to say that Clerks 2 had the better ending, and then cite Dante's speech about why he liked Empire better than Jedi. But I failed to realize he liked Empire because it had the "down" ending, making it more relative to real life, which is generally how I feel about the original Clerks, except I like happy endings better. Guess I'm more of a Randall guy :P
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#6 HardQuor
Member since 2007 • 1282 Posts

[QUOTE="HardQuor"]So, no one has any clue, 'eh?OrkHammer007

That last try didn't get it? :? I could swear it was right.

I just rewrote it to spit out the Fibonacci numbers so I could double check (using Wikipedia as a reference to make sure I got the right calculations), reran the sum, added the numbers on a calculator to triple check my results, and got...

4613732 ...which came straight from the last code snippet you posted.

I've never gotten my code to get that output.. I'm guessing that's probably right, but i don't want to put it in until i can get my code to back it up.

---edit---
aha! i found out what the problem is, by doing what you did, i just had it output term3 at the end of each do..while loop. aaand, it turns out that it's going one step over the 4 million mark for some reason.. gotta figure that out, now.

---re-edit---
nope, I was wrong again, i was actually reading a list of all thefibonacci sequence numbers, not the ones that were being totalled. So now i'm just totally confused, because when i checked the numbers being added together, it was all the rightones, and like you, i added them together manually to get the same sum that you got. But for some reason, my code is coming up with an extra 53410852 somewhere.

---re-re-edit---
OK! I FINALLY figured it out. Turns out that if i don't initialize a long integer, it defines itself as 53410852. So i went ahead and initialized it with a value of 0 and got our 4 million-ish number :lol: I knew from reading some books on C++ that it would be finicky, but JEEZ.

Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#7 HardQuor
Member since 2007 • 1282 Posts
So, no one has any clue, 'eh?
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#8 HardQuor
Member since 2007 • 1282 Posts

Well. I shortened the code to evaluate only term3:

do
{
    term3 = term1 + term2;
    if( term3 % 2 == 0 )
    {
        sum = term3 + sum;
     };
     term1 = term2;
     term2 = term3;
}while( term3 (less than or equal to) 4000000 );

and i get 58024584. But that's still wrong. I still don't know what the hell i'm doing wrong. this is pissing me off.
oh, also, term1 and term2 have been reduced to 0 and 1, respectively.

Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#9 HardQuor
Member since 2007 • 1282 Posts

Bloody hell... the problem just smacked me right in the face:

Why are you checking term1 and term2, when the Fibonacci term is term3? That's the only one you need to check. :P

Sorry I didn't catch that earlier.

OrkHammer007
Ugh. I think you nailed it. I can't believe the mistakes i'm making :( I think it's going to be a long, frustrating road ahead :(
Avatar image for HardQuor
HardQuor

1282

Forum Posts

0

Wiki Points

23

Followers

Reviews: 2

User Lists: 0

#10 HardQuor
Member since 2007 • 1282 Posts

I just copy/pasted what you wrote, with the following initial values:

long int term1 = 0; long int term2 = 1; long int term 3 = 0; long int sum = 0;

It compiled and ran fine. What's the answer supposed to be (I get  5702886)?

Oh... and I added a ; after the "while" part of the loop.

OrkHammer007

I just copy/pasted what you wrote, with the following initial values:

long int term1 = 0; long int term2 = 1; long int term 3 = 0; long int sum = 0;

It compiled and ran fine. What's the answer supposed to be (I get  5702886)?

Oh... and I added a ; after the "while" part of the loop.

OrkHammer007
I wish i knew the answer i'm supposed to be getting, but alas, the website won't tell me until i've got it right. Interestingly enough, the way the problem was phrased, i assumed my first two term values should be 1 and 2, but when i plugged in 0 and 1 (which make more sense) it gave me a different answer. Except the answer isn't the one you posted.. odd. instead, i get 59113738.