• Post Reply Bookmark Topic Watch Topic
  • New Topic

Please Help  RSS feed

 
Stacey Johnson
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI everyone,
I'm still working on this rational program I have to write. I'm writing a program that will compute the following summation series using rational class:
1/1 + 1/2 + 1/3 + ...+ 1/n
1/1 + 1/2 + 1/2^2 +...+ 1/2^n
I think I have the first part worked out mostly but now it's the second part. I know I definetly am doing something wrong. I'm trying to get the ^3's to increase up to 10 then give the sum. I don't know if I've don't that right. Can someone please help me!! I'm confused!
Below is what I've written so far:

I thank all in advance for their help.
Stacey
 
Julie de Wet
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

does nothing - there shouldn't be a semicolon after for(...)
 
Julie de Wet
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The sum of the second series converges to 2
[ April 18, 2004: Message edited by: Julie de Wet ]
 
Stacey Johnson
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the help, but can I get a little further explaination on the second half of the code. Because it won't compile and run yet I can't see the printout and deduct things from there.
Also I am getting a bunch of errors all pertaining to every "Rtnl" every time it comes up. All of the errors say it cannot resove symbol. I don't know what do to?
Can anyone give me some insight please?
Thanks Stacey
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you declared a class named Rtnl? If not, there's your problem. Can't create an instance of a class that doesn't exist. You will also have to put that public static void main(String [] args) method inside a class as well. Can't have a method outside of a class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!