public class MappingFormula {
//Mapping formula calculation for a custom map.
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
MappingFormula.formula();
}
public static void formula(){
Scanner keyboard = new Scanner(System.in);
int sizeW = 0;
int sizeL = 0;
int sizeH = 0;
double price = 0;
int levelOfDetail = 0;
int levelOfDetailPrice = 0;
double time = 0;
double timeOff = 0;
System.out.println("Enter the map width: ");
sizeW = keyboard.nextInt();
System.out.println("Enter the map length: ");
sizeL = keyboard.nextInt();
System.out.println("Enter the map height: ");
sizeH = keyboard.nextInt();
int size = (sizeW/2048*5 + sizeL/2048*5 + sizeH/2048*5);
price = size;
System.out.println(price);
System.out.println("Enter the level of detail, Low = 1, Medium = 2, High = 3)");
levelOfDetail = keyboard.nextInt();
if (levelOfDetail == 1)
{
levelOfDetailPrice = size+size/300;
price = levelOfDetailPrice + price;
}
if (levelOfDetail == 2)
{
levelOfDetailPrice = size+size/200;
price = levelOfDetailPrice + price;
}
if (levelOfDetail == 3)
{
levelOfDetailPrice = size+size/150;
price = levelOfDetailPrice + price;
}
time = price*.25+10;
price = time + price;
System.out.println("Your base price of the map is " + price + " with a default time limit");
System.out.println("Enter the number of days you want taken off");
timeOff = keyboard.nextInt();
price = timeOff+price;
System.out.println("The Final Price Is: " + price);
}
}
Now, that works fine and dandy in the program writer (Eclipse). But when I made a batch file that was
java MappingFormula
It should open the thing if i just put the Class file in the C:. So I did, and then I tried opening it elsewhere. But anytime I try to open it I get an error
"Exception in thread "main" java.lang.NoClassDefFoundError: MappingFormula"
Any ideas why?
Also, if someone can help me make a JAR file that someone can just click and have the program run in the command line thatd be awesome.




