Go Back   FlashFlashRevolution > Introductions > Chit Chat

Chit Chat Anything that doesn't neatly fit into one of the other categories. New users, please look at all the forums to make sure your topic doesn't belong elsewhere.

Reply
 
Thread Tools Display Modes
Old 10-11-2007, 10:28 PM   #1
SheSheChan
FFR Player
 
SheSheChan's Avatar
 
Join Date: Sep 2003
Location: VA
Age: 22
Posts: 66
Post I need help with something in my Java class.

I noticed the Programming forum was taken down so I'm hoping I'm posting this in the right area.



My mind just went blank, and I would love anyone who could help me out with any part of this. I know what I'm supposed to do but I can't think of what part of the equation would go in the rectangle/rhombus. Or even the equation itself. I can't think of how to get that pattern going. I'm pretty sure the checkmark by it means there's help on the textbook website but I can't find it. =x Thanks anyone~
__________________
there's too much blood in my caffeine system
SheSheChan is offline   Reply With Quote
Old 10-12-2007, 02:10 AM   #2
Squeek
let it snow~
 
Squeek's Avatar
 
FFR Veteran
Join Date: Jan 2004
Location: ZA WARUDO
Age: 26
Posts: 14,460
Send a message via AIM to Squeek
Default Re: I need help with something in my Java class.

The algorithm is easy. It is addition, after all.

int n = 10;
double x = 1; //Accounts for the initial "1+" step.
while (n > 0) {
x += 1/(n^2);
n--; }

I uninstalled Java on this computer when I quit Computer Science years ago so I can't test this, but it should work.

As for flowcharts, I was never one for explanatory coding. I coded to code. I quit Computer Science because everyone wanted rules and guidelines for how we should code. Also because Assembly Language sucked. Nobody should have rules placed on their coding technique. It's just stupid.

So, I can't help with the flowchart.
__________________


I'd be more apathetic if I weren't so lethargic.

Last edited by Squeek; 10-12-2007 at 02:14 AM..
Squeek is offline   Reply With Quote
Old 10-12-2007, 03:15 AM   #3
Hudelf
FFR Veteran
 
Hudelf's Avatar
 
FFR Veteran
Join Date: Aug 2007
Location: Florida, USA
Age: 25
Posts: 93
Default Re: I need help with something in my Java class.

Quote:
Originally Posted by Squeek View Post
As for flowcharts, I was never one for explanatory coding. I coded to code. I quit Computer Science because everyone wanted rules and guidelines for how we should code. Also because Assembly Language sucked. Nobody should have rules placed on their coding technique. It's just stupid.
Wow, my teachers seem to be a helluva lot better than yours were. My teachers have specifically told us that guidelines in coding are too restrictive, and will thus just tell us general conventions to follow, and good coding technique (How to avoid creating hard-to-debug errors, good commenting, etc). They also obviously teach us syntax and such, but never explicit rules to follow.

Also, with regards to your code segment, that should work. Obviously it's missing the class declaration, but that should be a given anyways.
Hudelf is offline   Reply With Quote
Old 10-12-2007, 05:43 AM   #4
SheSheChan
FFR Player
 
SheSheChan's Avatar
 
Join Date: Sep 2003
Location: VA
Age: 22
Posts: 66
Default Re: I need help with something in my Java class.

Quote:
Originally Posted by Squeek View Post
The algorithm is easy. It is addition, after all.

int n = 10;
double x = 1; //Accounts for the initial "1+" step.
while (n > 0) {
x += 1/(n^2);
n--; }
That's basically what my code looked like, with a few changes here and there. I'm preeeetty sure I got it right though. Thanks for your input though, I got to double check things. =)


What I actually got for psuedocode (we didn't actually have to write the code, we just started with things) was:

input: n

sum <- 0

i <- 1

repeat the following three steps while i < or = to n:

sq = i * i
sum <- sum + 1/sq
i = i + 1

output = sum

The point of doing this was more or less to make it general and usable with any variable.
__________________
there's too much blood in my caffeine system

Last edited by SheSheChan; 10-12-2007 at 09:06 PM..
SheSheChan is offline   Reply With Quote
Old 10-12-2007, 08:51 PM   #5
lord_carbo
FFR Player
 
lord_carbo's Avatar
 
Join Date: Dec 2004
Location: fighting villains from afar, NJ
Age: 21
Posts: 6,220
Send a message via AIM to lord_carbo
Default Re: I need help with something in my Java class.

Let's not let this thread become obsolete.

ITT the Riemann Hypothesis.

Anyone know some complex analysis?
lord_carbo is offline   Reply With Quote
Old 10-13-2007, 01:53 PM   #6
GuidoHunter
is against custom titles
 
GuidoHunter's Avatar
 
FFR Veteran
Join Date: Oct 2003
Location: Texas
Age: 28
Posts: 7,235
Send a message via AIM to GuidoHunter Send a message via Skype™ to GuidoHunter
Default Re: I need help with something in my Java class.

Quote:
Originally Posted by lord_carbo View Post
Anyone know some complex analysis?
A little, yes.

At the very least, I have an entire book on it.

--Guido

http://andy.mikee385.com
__________________

Quote:
Originally Posted by Grandiagod View Post
Quote:
Originally Posted by Grandiagod View Post
She has an asshole, in other pics you can see a diaper taped to her dead twin's back.
Sentences I thought I never would have to type.
GuidoHunter is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution