It's been a while since I've done some Java coding but here is a simple program, I did to calculate markup for my retail store. How would I be able to make the program loop until I close it myself? Right now, I run this program in my terminal/command prompt and each time I enter a value it ends, so I am forced to execute it again which takes some time (about .05 seconds or less) however I need all the time I can get with this task I am doing. So the point is to keep it running until I close it myself.
import static java.lang.System.out;
import java.util.Scanner;
public class ProductMarkup {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner myScanner = new Scanner(System.in);
out.print("What is the quantity?");
int quantity = myScanner.nextInt();
out.print("What is the wholesale price?");
double wsprice = myScanner.nextDouble();
if (quantity == 1) {
double math = (int) (wsprice * .70);
double retail = math + wsprice;
out.println(retail + 5);
} else if (quantity == 2) {
double math = wsprice * 2;
double retail = math + 10;
out.println(retail);
} else if (quantity == 3) {
double math = wsprice * 2.5;
double retail = math + 5.75;
out.println(retail);
} else if (quantity == 4) {
double math = wsprice * 2.80;
double retail = math + 3.75;
out.println(retail);
}
}
}