Quote:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Prices;
import javax.swing.JOptionPane;
import java.util.Arrays;
import java.text.*;
import java.util.*;
public class prices {
public static void main(String[] args) {
String input;
String message;
DecimalFormat showPrice = new DecimalFormat("$,###.00");
input = JOptionPane.showInputDialog("Enter the amount of prices you are going to enter!?");
int size = Integer.parseInt(input);
double price[] = new double[size];
for(int i = 0; i < size ; i++){
input = JOptionPane.showInputDialog("Enter the price!?" + (i+1));
price[i] = Double.parseDouble(input);
}
for(int i = 0; i < size ; i++){
}
Arrays.sort(price);
JOptionPane.showMessageDialog(null,"Your price is \n" + showPrice.format(price[0]));
}
}