User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,917 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,716 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 7330 | Replies: 4
Reply
Join Date: Oct 2004
Posts: 15
Reputation: Hjcooke is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Hjcooke Hjcooke is offline Offline
Newbie Poster

Help Cylinder surface, area, height etc etc

  #1  
Oct 7th, 2004
Hi, im using a code snippet found on this website,

ylinderVolume


A simplistic program to compute the volume of a cylinder when its radius and length are input via MyInput.class



code snippet donated to daniweb by: cscgal    ( all code snippets bycscgal )


views: 52


syntax language: java122



package cylindervolume;
public class CylinderVolume
{
public static void main(String args[])
{
double pi = 3.14;
double radius, length;
System.out.print("Please enter radius of cylinder: ");
radius = MyInput.readDouble();
System.out.print("Please enter length of cylinder: ");
length = MyInput.readDouble();
System.out.print("Volume = " + (radius*radius*pi*length));
}
}

i studied visual basic last semester at university very hard, and know im struggling again with java. Programming is the only module that i struggle with. All of the others, website management, ssadm i can do with ease but this is just imposible to me. So any help would be very appreciated. As well as the volume i have to calculate the surface are, set the height, set the radius of the base and set the center of the base.

Any ideas?

Many thanks.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Cylinder surface, area, height etc etc

  #2  
Oct 7th, 2004
what exactly are you needing help with?
Reply With Quote  
Join Date: Oct 2004
Posts: 15
Reputation: Hjcooke is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Hjcooke Hjcooke is offline Offline
Newbie Poster

Re: Cylinder surface, area, height etc etc

  #3  
Oct 7th, 2004
As well as calculating the volume of the cylinder which is already in this sample of code, i have to calculate the surface area, set the height, set the radius of the base, and set the center of the base.
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Cylinder surface, area, height etc etc

  #4  
Oct 7th, 2004
When you say that you want to set the radius and stuff, do you mean that you want user input?
Reply With Quote  
Join Date: Oct 2004
Posts: 15
Reputation: Hjcooke is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Hjcooke Hjcooke is offline Offline
Newbie Poster

Re: Cylinder surface, area, height etc etc

  #5  
Oct 8th, 2004
Yes, so that all of the other calculations that are being asked work as well ans coinsine with each other.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 8:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC