943,425 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 15424
  • Java RSS
Oct 7th, 2004
0

Cylinder surface, area, height etc etc

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Hjcooke is offline Offline
15 posts
since Oct 2004
Oct 7th, 2004
0

Re: Cylinder surface, area, height etc etc

what exactly are you needing help with?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Oct 7th, 2004
0

Re: Cylinder surface, area, height etc etc

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Hjcooke is offline Offline
15 posts
since Oct 2004
Oct 7th, 2004
0

Re: Cylinder surface, area, height etc etc

When you say that you want to set the radius and stuff, do you mean that you want user input?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Oct 8th, 2004
0

Re: Cylinder surface, area, height etc etc

Yes, so that all of the other calculations that are being asked work as well ans coinsine with each other.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Hjcooke is offline Offline
15 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: casting error
Next Thread in Java Forum Timeline: Unsure of where to put classpath for mail.jar





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC