just made a calculator type simple program....I need a way to compile it to ruanable jar...how do I do this in eclipse...I'm very new to programming so pardon me if I'm not very clear in my question...
here's my source code
package lvlup;
import java.awt.color.*;
import java.math.*;
import java.util.Scanner;
public class methods {
public methods(){
System.out.println("Choose an option/n");
System.out.println(" press 1 for derivative calculator (known polynomials)");
int Choice;
Scanner c = new Scanner(System.in);
Choice = c.nextInt();
switch (Choice){
case 1:
derCal();
}
}
private void derCal() {
double x;
double n;
long der;
Scanner sc = new Scanner (System.in);
System.out.println("welcome to the derivative calc");
System.out.println("insert x");
x = sc.nextDouble();
System.out.println("insert n now/ n=1 default");
n = sc.nextDouble();
der = (long) (n*Math.pow(x, n-1));
System.out.println("the answer is :" + der);
}
public static void main (String args []){methods m = new methods();
}
}
To create a new runnable JAR file in the workbench:
source: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-37.htm
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments