1. public class naloga_5 {
  2. public static void main(String[] args) {
  3. int cena, n = 0;
  4. String niz = javax.swing.JOptionPane.showInputDialog("Koliko zneskov želiš pretvoriti?");
  5. try {
  6. n = Integer.valueOf(niz).intValue();
  7. } catch(Exception e) {
  8. System.exit(0);
  9. }
  10.  
  11. for(int i = 0; i < n;) {
  12. niz = javax.swing.JOptionPane.showInputDialog("Vpiši znesek!");
  13. try {
  14. cena = Integer.valueOf(niz).intValue();
  15. i++;
  16. } catch(Exception e) {
  17. continue;
  18. }
  19.  
  20. System.out.format("%4d SIT = %4fEvrov%n", cena, (float)cena / 239.64f);
  21. }
  22. }
  23. }