Hello, first off I am not quite sure if I am in the right section to be posting this. Second off I need help turning this .java file into an exe file so it can be used at any computer without any additional programs other than the cmd prompt. I have looked up countless tutorials and explanations and nothing works or makes sense to me. It would be greatly appreciated if someone could possibly do it for me and link a download for it. However, at the very least, explain to me step by step how to do it. Thanks in advanced
Here is the code:
//Nicholas Frechette's program.
import TerminalIO.KeyboardReader;
import java.text.DecimalFormat;
class copyprice {
public static void main(String args[]) {
KeyboardReader reader = new KeyboardReader();
DecimalFormat threeDecimal = new DecimalFormat("0.00");
double a, m;
double A = 0.16, B = 0.2, C = 0.58, D = 0.4, E = 0.23;
char ans;
System.out.println("Would you like to intiate the program? (Y or N)");
ans = reader.readChar();
while(ans == 'Y') {
System.out.println("How many pages do you need printed?");
a = reader.readDouble("");
if(a<21 && a>0){
m = a*(1+(A));
System.out.println("Cost of " + a + " copies is $" + threeDecimal.format(m) + ".");
System.out.println("");
System.out.println("");
}
if(a>20 && a<51){
m = (23+(B)) + ((a-20)*(C));
System.out.println("Cost of " + a + " copies is $" + threeDecimal.format(m) + ".");
System.out.println("");
System.out.println("");
}
if(a>50){
m = (23+(B)) + (17+(D)) + ((a-50)*(E));
System.out.println("Cost of " + a + " copies is $" + threeDecimal.format(m) + ".");
System.out.println("");
System.out.println("");
}
System.out.println("Would you like to rerun the program? (Y or N)");
ans = reader.readChar();
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
}
}
}