Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 22nd, 2007, 01:29 AM
listairee listairee is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 1 listairee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 3 sec
Reputation Power: 0
Help needed on Java Assignment.

Anyone can help me with this?

Write a complete Java application which prompts the user for the int radius of a sphere, and call method sphereVolume to calculate and display the volume of that sphere (there is NO return value required), using the formula:volume = ( 4.0 / 3.0 ) * Math.PI * Math.pow( radius, 3 ). The user should input the radius through the inputRadius method and RETURN the value of radius.

Thanks

Reply With Quote
  #2  
Old July 26th, 2007, 06:03 PM
xreddawg909x xreddawg909x is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 91 xreddawg909x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 3
well create a jframe with the textfield

Enter Radus:_________


and another textfield

SphereVolume________(a) (to show answer ;would be good to make it uneditable)

make a JButton called "Calculate" (answer) ,add an actionlistener to the button

when clicked

void parse()
{
a function to parse the inputted radius in inches
}

actionPerformed( event .evt )
{

if( evt.getSource == Calculated)
{
private void calc(int/float x)
{
answer= calculations here using the variable (parsed x)
}
}

}

thats about the gist of what your program should do, assuming you know how to create JButtons, JFormattedTextfields, parse functions and actionlisteners

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Help needed on Java Assignment.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT