Hey Dog,
Learning a bit of java at the moment.
I wrote a small app that simply will take input from a user for the radius of a cirlce then spit out the Area, circumference, and diameter. Here is my code. But what I'd like to do is compile it as an exe or i'm thinking .jar file so I can simply run it in an OS environment. Can you point me in the right direction on how to do this. Doesn't seem my app "eclipse" can do this or at least I'm not seeing it. Here's my code.
<br /> /***********************************************************************<br /> Program Name: Circle.java<br /> Programmers Name: Glen Ciszewski<br /> Program Description: This program will calculate the area, circumference and diameter of a circle<br /> ***********************************************************************/<br /> import javax.swing.JOptionPane;<br /> public class Circle <br /> {<br /> <br /> <br /> public static void main(String[] args) <br /> {<br /> String userInput; //number entered by user<br /> int radius; //converted input for number<br /> double diameter; //the diamater of the circle<br /> double circumference; //the circumference of the circle<br /> double area; //the area of the circle<br /> <br /> //read in the users input as string<br /> userInput = JOptionPane.showInputDialog("Enter in the radius");<br /> <br /> //convert number from string to type int<br /> radius = Integer.parseInt(userInput);<br /> <br /> //find the diameter<br /> diameter = 2*radius;<br /> <br /> //display the diameter<br /> JOptionPane.showMessageDialog(null,"The diameter is " + diameter,<br /> "Results",<br /> JOptionPane.PLAIN_MESSAGE);<br /> <br /> //find the circumference<br /> circumference = 2*Math.PI*radius;<br /> <br /> //display the circumference<br /> JOptionPane.showMessageDialog(null,"The circumference is " + circumference,<br /> "Results",<br /> JOptionPane.PLAIN_MESSAGE);<br /> <br /> //find the area<br /> area = Math.PI*radius*radius;<br /> <br /> //display the area<br /> JOptionPane.showMessageDialog(null,"The area is " + area,<br /> "Results",<br /> JOptionPane.PLAIN_MESSAGE);<br /> System.exit(0);<br /> <br /> }<br /> <br /> }<br />


Member Buzz
1 day 13 hours ago
3 days 16 hours ago
3 days 17 hours ago
5 days 18 hours ago
5 days 21 hours ago
5 days 21 hours ago
5 days 23 hours ago
6 days 10 min ago
6 days 3 hours ago
6 days 11 hours ago