• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Please Help

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic