Google Answers Logo
View Question
 
Q: Computing PI using Java ( No Answer,   1 Comment )
Question  
Subject: Computing PI using Java
Category: Computers > Programming
Asked by: 4meractor-ga
List Price: $5.00
Posted: 13 Jul 2005 07:42 PDT
Expires: 12 Aug 2005 07:42 PDT
Question ID: 543025
How do I calculate pi (Using Gregory Series) in Java with input dialog
boxes?  I need to prompt the user for the number of terms to estimate
pi.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Computing PI using Java
From: mikm-ga on 19 Jul 2005 16:00 PDT
 
I would recommed writing a seperate backend class to handle the PI
computation.  Have a method take all the necessary inputs then return
PI.

If you just need popups for inputs, use JOptionPane.showInputDialog()
and JOptionPane.showMessageDialog()
[http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html
< api] methods for input and response.  Write a simple program to use
these to feed inputs into the backend class and return the response.

If you need something more complex, the frontend using the Swing
library.  If you  don't know how,
http://java.sun.com/docs/books/tutorial/uiswing/ is a good resource.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy