10-11-2007, 10:28 PM | #1 |
FFR Player
Join Date: Sep 2003
Location: VA
Age: 33
Posts: 66
|
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 |
10-12-2007, 02:10 AM | #2 |
let it snow~
|
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. Last edited by Squeek; 10-12-2007 at 02:14 AM.. |
10-12-2007, 03:15 AM | #3 | |
FFR Veteran
Join Date: Aug 2007
Location: Florida, USA
Age: 36
Posts: 93
|
Re: I need help with something in my Java class.
Quote:
Also, with regards to your code segment, that should work. Obviously it's missing the class declaration, but that should be a given anyways. |
|
10-12-2007, 05:43 AM | #4 | |
FFR Player
Join Date: Sep 2003
Location: VA
Age: 33
Posts: 66
|
Re: I need help with something in my Java class.
Quote:
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.. |
|
10-13-2007, 01:53 PM | #6 |
is against custom titles
|
Re: I need help with something in my Java class.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|