Next time you post, please use code tags around your code, such as ones in my signature.
For now Ill repost your code in a readable form.
public class Store {
private String price;
private String time;
public void calculatePrice(String[] args) {
int[] prices = new int[]{5, 15, 20};
int service a = 20;
int service b = 15;
int service c = 5;
for (int i = 0; i < prices.length; i++) {
price = price + prices[i];
}
}
public static void main(String[] args) {
Store one = new Store();
try {
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Error. You must enter command line");
System.out.println(e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Error. First argument must be an integer");
} finally {
System.out.println("Program has ended");
}
}
}
Ok, to start off...
int service a = 20; is wrong as
service a is the identifier of your variable and having a space between service and a is illegal.
An example of a legal identifer would be serviceA.
To read user input from the console, you should take a look at the Scanner class.
Scanner (Java 2 Platform SE 5.0)
For a neat little guide on how to use Scanner, take a look at this
How-To-Guide